Fix race condition in test_sunos_get_uptime_facts

Mock time.time() to return consistent time value.
This commit is contained in:
Sam Doran 2019-08-29 00:34:00 -04:00 committed by Matt Clay
parent e5b24a68cc
commit 48a67f4465

View file

@ -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']