-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/unit/config/__init__.py
-> tests/unit/config/test_config.py
No top level `__init__.py` should contain tests
- Loading branch information
Showing
2 changed files
with
32 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1 @@ | ||
# -*- 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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- 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} |