def test_should_call_update_stats(self): stub_callback = StubTimer() sensors = Mock() Tracker(Mock(), sensors, stub_callback).track(300) stub_callback.signal_time_elapsed() sensors.update_averages.assert_called_once_with(None)
def test_should_log_current_position_callback_every_time_callback_fires(self): stub_callback = StubTimer() sensors = Mock() Tracker(Mock(), sensors, stub_callback).track(300) stub_callback.signal_time_elapsed() stub_callback.signal_time_elapsed() stub_callback.signal_time_elapsed() self.assertEqual(sensors.log_values.call_count, 3)
def test_should_log_current_position_callback_every_time_callback_fires( self): stub_callback = StubTimer() sensors = Mock() Tracker(Mock(), sensors, stub_callback).track(300) stub_callback.signal_time_elapsed() stub_callback.signal_time_elapsed() stub_callback.signal_time_elapsed() self.assertEqual(sensors.log_values.call_count, 3)