Example #1
0
 def test_get_publisher_topics(self):
     connection = ClientConnection(websocket=None)
     connection.add_publishing_channel(11, "dont.try.anything")
     connection.add_publishing_channel(42, "reason.for.life")
     expected_topics = ["dont.try.anything", "reason.for.life"]
     topics = connection.get_publisher_topics()
     self.assertEqual(sorted(topics), expected_topics)
Example #2
0
 def test_get_topics(self):
     connection = ClientConnection(websocket=None)
     connection.add_subscription_channel(12, "whiplash")
     connection.add_publishing_channel(21, "reload")
     topics = connection.get_topics()
     expected_topics = {'reload': 21, 'whiplash': 12}
     self.assertEqual(topics, expected_topics)
Example #3
0
 def test_get_publisher_topics(self):
     connection = ClientConnection(websocket=None)
     connection.add_publishing_channel(11, "dont.try.anything")
     connection.add_publishing_channel(42, "reason.for.life")
     expected_topics = ["dont.try.anything", "reason.for.life"]
     topics = connection.get_publisher_topics()
     self.assertEqual(sorted(topics), expected_topics)
Example #4
0
 def test_get_topics(self):
     connection = ClientConnection(websocket=None)
     connection.add_subscription_channel(12, "whiplash")
     connection.add_publishing_channel(21, "reload")
     topics = connection.get_topics()
     expected_topics = {'reload': 21, 'whiplash': 12}
     self.assertEqual(topics, expected_topics)
Example #5
0
 def test_add_publishing_channel(self):
     connection = ClientConnection(websocket=None)
     connection.add_publishing_channel(42, "reason.for.life")
     expected_topics = {
         "publisher": {
             "reason.for.life": 42
         },
         'subscriber': {}
     }
     self.assertEqual(connection.topics, expected_topics)
Example #6
0
 def test_add_publishing_channel(self):
     connection = ClientConnection(websocket=None)
     connection.add_publishing_channel(42, "reason.for.life")
     expected_topics = {
         "publisher": {
             "reason.for.life": 42
         },
         'subscriber': {}
     }
     self.assertEqual(connection.topics, expected_topics)