mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #51558 from bdrung/test-zypp-plugin
Do not load zyppnotify file on module import
This commit is contained in:
commit
f87d5eccea
@ -25,8 +25,10 @@ if sys.version_info >= (3,):
|
||||
else:
|
||||
BUILTINS_OPEN = '__builtin__.open'
|
||||
|
||||
zyppnotify = imp.load_source('zyppnotify', os.path.sep.join(os.path.dirname(__file__).split(
|
||||
os.path.sep)[:-2] + ['scripts', 'suse', 'zypper', 'plugins', 'commit', 'zyppnotify']))
|
||||
ZYPPNOTIFY_FILE = os.path.sep.join(
|
||||
os.path.dirname(__file__).split(os.path.sep)[:-2] +
|
||||
['scripts', 'suse', 'zypper', 'plugins', 'commit', 'zyppnotify']
|
||||
)
|
||||
|
||||
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
@ -40,6 +42,7 @@ class ZyppPluginsTestCase(TestCase):
|
||||
Returns:
|
||||
|
||||
'''
|
||||
zyppnotify = imp.load_source('zyppnotify', ZYPPNOTIFY_FILE)
|
||||
drift = zyppnotify.DriftDetector()
|
||||
drift._get_mtime = MagicMock(return_value=123)
|
||||
drift._get_checksum = MagicMock(return_value='deadbeef')
|
||||
|
Loading…
Reference in New Issue
Block a user