Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
  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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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"])
Exemplo n.º 5
0
  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)
Exemplo n.º 6
0
  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"])