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)
def test_can_increment_a_missing_field(self): stats = AioStompStats() stats.increment("something") self.assertEqual(stats.connection_stats[0]["something"], 1)
def test_can_increment_a_field(self): stats = AioStompStats() stats.increment('sent_msg') self.assertEqual(stats.connection_stats[0]['sent_msg'], 1)