1"""Tests for mysql_stats.""" 2 3import common 4 5import collections 6import mock 7import unittest 8 9import mysql_stats 10 11 12class MysqlStatsTest(unittest.TestCase): 13 """Unittest for mysql_stats.""" 14 15 def testQueryAndEmit(self): 16 """Test for QueryAndEmit.""" 17 connection = mock.Mock() 18 connection.Fetchall.return_value = [( 19 'Column-name', 0)] 20 21 # This shouldn't raise an exception. 22 mysql_stats.QueryAndEmit(collections.defaultdict(lambda: 0), connection) 23 24 25if __name__ == '__main__': 26 unittest.main() 27