Fix race condition in test_sunos_get_uptime_facts
Mock time.time() to return consistent time value.
This commit is contained in:
parent
e5b24a68cc
commit
48a67f4465
1 changed files with 4 additions and 3 deletions
|
@ -11,6 +11,7 @@ def test_sunos_get_uptime_facts(mocker):
|
|||
|
||||
inst = sunos.SunOSHardware(module)
|
||||
|
||||
with mocker.patch('time.time', return_value=1567052602.5089788):
|
||||
expected = int(time.time()) - 1548249689
|
||||
result = inst.get_uptime_facts()
|
||||
assert expected == result['uptime_seconds']
|
||||
|
|
Loading…
Reference in a new issue