def test_unsubscribe_all_without_topic(ed): listener = lambda x: x listener2 = lambda y: y ed.subscribe("T1", listener, lambda x: True) ed.subscribe("T2", listener2, lambda x: True) ed.unsubscribe_all() assert not ed.DB
def test_unsubscribe_all_with_Topic(ed): listener = lambda x: x listener2 = lambda y: y ed.subscribe("T1", listener, lambda x: True) ed.subscribe("T2", listener2, lambda x: True) ed.unsubscribe_all("T1") assert ("T1" not in ed.DB and len(ed.DB["T2"]) == 1)