Example #1
0
    def test_nominal(self, mocker):
        frame_mock = mocker.Mock(spec=Frame)
        mocker.patch(
            f"{CLASS_DEFINITION_PATH}.current",
            new_callable=lambda: frame_mock,
        )
        fs = FrameSetFactory()
        tick = TickFactory()

        fs.add_tick_to_last(tick)

        assert frame_mock.on_new_tick.call_args_list == [call(tick)]
Example #2
0
    def test_no_current(self, mocker):
        mocker.patch(f"{CLASS_DEFINITION_PATH}.current",
                     new_callable=lambda: None)
        fs = FrameSetFactory()

        assert fs.add_tick_to_last(TickFactory()) is None