Beef-up tests.

This commit is contained in:
Raymond Hettinger 2009-03-03 07:12:09 +00:00
parent a07038d614
commit f17f81d9c8
1 changed files with 6 additions and 3 deletions

View File

@ -645,9 +645,12 @@ class TestOrderedDict(unittest.TestCase):
shuffle(pairs) shuffle(pairs)
od = OrderedDict(pairs) od = OrderedDict(pairs)
self.assertEqual(list(od), [t[0] for t in pairs]) self.assertEqual(list(od), [t[0] for t in pairs])
self.assertEqual(list(od.keys()), [t[0] for t in pairs]) self.assertEqual(od.keys()[:], [t[0] for t in pairs])
self.assertEqual(list(od.values()), [t[1] for t in pairs]) self.assertEqual(od.values()[:], [t[1] for t in pairs])
self.assertEqual(list(od.items()), pairs) self.assertEqual(od.items()[:], pairs)
self.assertEqual(list(od.iterkeys()), [t[0] for t in pairs])
self.assertEqual(list(od.itervalues()), [t[1] for t in pairs])
self.assertEqual(list(od.iteritems()), pairs)
self.assertEqual(list(reversed(od)), self.assertEqual(list(reversed(od)),
[t[0] for t in reversed(pairs)]) [t[0] for t in reversed(pairs)])