def test_doing_persists(): t = Ticker(1) t.add_command(foo_function_1) t.add_command(foo_function_2) olddoing = t.doing t = pickle.loads(pickle.dumps(t)) assert t.doing == olddoing
def test_clears_doing_list(): def doing_list_checker(): assert not ticker.doing ticker = Ticker(1) ticker.add_command(doing_list_checker) ticker.tick()
def test_command_added(): t = Ticker(1) #hackish called = [] t.add_command(lambda: called.append(True)) t.tick() assert called