def test_disconnect(self): event = Event() @event.connect def test1(): pass event.disconnect(test1) self.assertSetEqual(event.receivers, set())
def test_disconnect_invalid(self): event = Event() @event.connect def test1(): pass def test2(a, b, c): pass event.disconnect(test2) self.assertSetEqual(event.receivers, {test1})