def test_unsubscribe_not_existing(self): p = PubSubManager() p.unsubscribe("client", "topic") # check that the topic wasn't created self.assertTrue("topic" not in p.subscriptions)
def test_unsubscribe_existing_last(self): p = PubSubManager() p.subscriptions["topic"] = {"client"} p.unsubscribe("client", "topic") # check that the topic was garbage collected self.assertTrue("topic" not in p.subscriptions)
def test_unsubscribe_existing(self): p = PubSubManager() p.subscriptions["topic"] = {"client", "other client"} p.unsubscribe("client", "topic") # check that we are not subbed anymore self.assertTrue("client" not in p.subscriptions["topic"])
def test_unsubscribe_existing_last(self): p = PubSubManager() p.subscriptions["topic"] = set(["client"]) p.unsubscribe("client", "topic") # check that the topic was garbage collected self.assertTrue("topic" not in p.subscriptions)
def test_unsubscribe_existing(self): p = PubSubManager() p.subscriptions["topic"] = set(["client", "other client"]) p.unsubscribe("client", "topic") # check that we are not subbed anymore self.assertTrue("client" not in p.subscriptions["topic"])