Skip to content

Commit

Permalink
make tests more resilent
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Kim committed Jan 31, 2017
1 parent 9eecc89 commit 1811685
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,14 @@ def test_strtime(self, time_service):
# second call should use cached value
assert time_service.strtime() == 'Sun, 30 Oct 2016 03:13:52 GMT'

def test_recalc_time(self, time_service):
def test_recalc_time(self, time_service, mocker):
mocker.spy(time_service._loop, 'time')

time_service._time = 123
time_service._strtime = 'asd'
time_service._on_cb()
assert time_service._strtime is None
assert time_service._time > 1234
assert time_service._loop.time.called

def test_call_later(self, time_service):
time_service._loop.time = mock.Mock()
Expand Down

0 comments on commit 1811685

Please sign in to comment.