• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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        cursor = mock.Mock()
18        cursor.fetchone.return_value = ('Column-name', 0)
19
20        # This shouldn't raise an exception.
21        mysql_stats.QueryAndEmit(collections.defaultdict(lambda: 0), cursor)
22
23
24if __name__ == '__main__':
25    unittest.main()
26