mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Skip test_drift_detector if required test file is missing
The release tarball does not contain the file `scripts/suse/zypper/plugins/commit/zyppnotify`, which causes `ZyppPluginsTestCase.test_drift_detector` to fail: ``` ERROR: test_drift_detector (unit.test_zypp_plugins.ZyppPluginsTestCase) [CPU:0.0%|MEM:5.5%] ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/unit/test_zypp_plugins.py", line 45, in test_drift_detector zyppnotify = imp.load_source('zyppnotify', ZYPPNOTIFY_FILE) File "/usr/lib/python3.7/imp.py", line 171, in load_source module = _load(spec) File "<frozen importlib._bootstrap>", line 696, in _load File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 724, in exec_module File "<frozen importlib._bootstrap_external>", line 859, in get_code File "/usr/lib/python3.7/imp.py", line 157, in get_data return super().get_data(path) File "<frozen importlib._bootstrap_external>", line 916, in get_data FileNotFoundError: [Errno 2] No such file or directory: 'scripts/suse/zypper/plugins/commit/zyppnotify' ``` Therefore skip `ZyppPluginsTestCase.test_drift_detector` if `zyppnotify` cannot be found. Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
This commit is contained in:
parent
71a71d4822
commit
288dc09458
1 changed files with 4 additions and 0 deletions
|
@ -39,6 +39,10 @@ class ZyppPluginsTestCase(TestCase):
|
|||
Test shipped libzypp plugins.
|
||||
"""
|
||||
|
||||
@skipIf(
|
||||
not os.path.exists(ZYPPNOTIFY_FILE),
|
||||
"Required file '{}' does not exist.".format(ZYPPNOTIFY_FILE),
|
||||
)
|
||||
def test_drift_detector(self):
|
||||
"""
|
||||
Test drift detector for a correct cookie file.
|
||||
|
|
Loading…
Add table
Reference in a new issue