Browse Source

[2781] define items() in DummDict class instead of using lambda, update note

Naoki Kambe 11 years ago
parent
commit
3669c95989
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/bin/stats/tests/stats_test.py

+ 4 - 4
src/bin/stats/tests/stats_test.py

@@ -1397,11 +1397,11 @@ class TestStats(unittest.TestCase):
         """Test _query_statistics returns a list of pairs of module and
         sequences from group_sendmsg()"""
         stat = MyStats()
-        # imitate stat.get_statistics_data().items
+        # imitate stat.get_statistics_data().items. The order of the array
+        # returned by items() should be preserved.
         class DummyDict:
-            items = lambda x: [
-                ('Init', 'dummy'), ('Stats', 'dummy'), ('Auth', 'dummy'),
-                ]
+            def items(self):
+                return [('Init', 'dummy'), ('Stats', 'dummy'), ('Auth', 'dummy')]
         stat.get_statistics_data = lambda: DummyDict()
         mod = ('Init', 'Auth', 'Auth')
         seq = [('Init', stat._seq + 1),