mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Move tests to existing test modules
This commit is contained in:
parent
46816092eb
commit
8e505fb91a
2 changed files with 18 additions and 32 deletions
|
@ -1,32 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
# Import Salt Testing Libs
|
||||
from tests.support.unit import TestCase, skipIf
|
||||
import tests.support.mock as mock
|
||||
|
||||
import salt.config
|
||||
import salt.syspaths
|
||||
|
||||
|
||||
class ConfigTest(TestCase):
|
||||
|
||||
def test_validate_bad_pillar_roots(self):
|
||||
expected = salt.config._expand_glob_path(
|
||||
[salt.syspaths.BASE_PILLAR_ROOTS_DIR]
|
||||
)
|
||||
with mock.patch('salt.config._normalize_roots') as mk:
|
||||
ret = salt.config._validate_pillar_roots(None)
|
||||
assert not mk.called
|
||||
assert ret == {'base': expected}
|
||||
|
||||
def test_validate_bad_file_roots(self):
|
||||
expected = salt.config._expand_glob_path(
|
||||
[salt.syspaths.BASE_FILE_ROOTS_DIR]
|
||||
)
|
||||
with mock.patch('salt.config._normalize_roots') as mk:
|
||||
ret = salt.config._validate_file_roots(None)
|
||||
assert not mk.called
|
||||
assert ret == {'base': expected}
|
|
@ -560,6 +560,15 @@ class ConfigTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
|
|||
os.path.join(tempdir, 'c')
|
||||
]))
|
||||
|
||||
def test_validate_bad_file_roots(self):
|
||||
expected = salt.config._expand_glob_path(
|
||||
[salt.syspaths.BASE_FILE_ROOTS_DIR]
|
||||
)
|
||||
with mock.patch('salt.config._normalize_roots') as mk:
|
||||
ret = salt.config._validate_file_roots(None)
|
||||
assert not mk.called
|
||||
assert ret == {'base': expected}
|
||||
|
||||
@with_tempfile()
|
||||
@with_tempdir()
|
||||
def test_master_pillar_roots_glob(self, tempdir, fpath):
|
||||
|
@ -583,6 +592,15 @@ class ConfigTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
|
|||
os.path.join(tempdir, 'c')
|
||||
]))
|
||||
|
||||
def test_validate_bad_pillar_roots(self):
|
||||
expected = salt.config._expand_glob_path(
|
||||
[salt.syspaths.BASE_PILLAR_ROOTS_DIR]
|
||||
)
|
||||
with mock.patch('salt.config._normalize_roots') as mk:
|
||||
ret = salt.config._validate_pillar_roots(None)
|
||||
assert not mk.called
|
||||
assert ret == {'base': expected}
|
||||
|
||||
@with_tempdir()
|
||||
def test_master_id_function(self, tempdir):
|
||||
master_config = os.path.join(tempdir, 'master')
|
||||
|
|
Loading…
Add table
Reference in a new issue