Ejemplo n.º 1
0
    def test_can_print_stats(self, logger_mock):
        stats = AioStompStats()
        stats.increment("sent_msg")

        stats.print_stats()

        self.assertEqual(logger_mock.info.call_count, 5)
Ejemplo n.º 2
0
    def test_can_increment_a_missing_field(self):
        stats = AioStompStats()
        stats.increment("something")

        self.assertEqual(stats.connection_stats[0]["something"], 1)
Ejemplo n.º 3
0
    def test_can_increment_a_field(self):
        stats = AioStompStats()
        stats.increment('sent_msg')

        self.assertEqual(stats.connection_stats[0]['sent_msg'], 1)