mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Add UT for Debian on get_hwclock
This commit is contained in:
parent
d337c09357
commit
c3cafed6d5
@ -216,3 +216,18 @@ class TimezoneTestCase(TestCase):
|
||||
name, args, kwarg = timezone.__salt__['cmd.run'].mock_calls[0]
|
||||
assert args == (['tail', '-n', '1', '/etc/adjtime'],)
|
||||
assert kwarg == {'python_shell': False}
|
||||
|
||||
@patch('salt.utils.which', MagicMock(return_value=False))
|
||||
@patch('os.path.exists', MagicMock(return_value=True))
|
||||
@patch('os.unlink', MagicMock())
|
||||
@patch('os.symlink', MagicMock())
|
||||
def test_get_hwclock_debian(self):
|
||||
'''
|
||||
Test get hwclock Debian
|
||||
:return:
|
||||
'''
|
||||
timezone.__grains__['os_family'] = ['Debian']
|
||||
timezone.get_hwclock()
|
||||
name, args, kwarg = timezone.__salt__['cmd.run'].mock_calls[0]
|
||||
assert args == (['tail', '-n', '1', '/etc/adjtime'],)
|
||||
assert kwarg == {'python_shell': False}
|
||||
|
Loading…
Reference in New Issue
Block a user