Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)