def test_clear_state_resets(self): a = Tracker(states) a.set_state('foo', sentinel_a) a.set_state('foo', sentinel_b) a.clear_state('foo') self.assertEqual(len(a.in_state('foo')), 0)
def test_clear_removes_from_all(self): a = Tracker(states) a.set_state('foo', sentinel_a) a.set_state('bar', sentinel_b) a.set_state('baz', sentinel_b) a.clear_state('foo', sentinel_a) a.clear_state('baz', sentinel_b) self.assertEqual({sentinel_b}, set(a.all))