Fixing failing test_set_hwclock_aix test.

This commit is contained in:
Gareth J. Greenaway 2018-06-13 10:13:44 -07:00
parent ccb0acc958
commit 7c472fed51
No known key found for this signature in database
GPG key ID: 10B62F8A7CAD7A41

View file

@ -349,10 +349,11 @@ class TimezoneModuleTestCase(TestCase, LoaderModuleMockMixin):
Test set hwclock on AIX
:return:
'''
with patch.dict(timezone.__grains__, {'os_family': ['AIX']}):
with self.assertRaises(SaltInvocationError):
assert timezone.set_hwclock('forty two')
assert timezone.set_hwclock('UTC')
for osfamily in ['AIX', 'NILinuxRT']:
with patch.dict(timezone.__grains__, {'os_family': osfamily}):
with self.assertRaises(SaltInvocationError):
assert timezone.set_hwclock('forty two')
assert timezone.set_hwclock('UTC')
@skipIf(salt.utils.is_windows(), 'os.symlink not available in Windows')
@patch('salt.utils.which', MagicMock(return_value=False))