1
0
mirror of https://github.com/django/django.git synced 2025-03-06 07:22:32 +00:00

Added tests for reversed iteration over SortedDict.

This commit is contained in:
Mitar 2012-10-15 12:12:10 -07:00
parent c3fabb282d
commit 2811e543c6

View File

@ -128,6 +128,12 @@ class SortedDictTests(SimpleTestCase):
self.assertEqual(self.d1, {})
self.assertEqual(self.d1.keyOrder, [])
def test_reversed(self):
self.assertEqual(list(self.d1), [7, 1, 9])
self.assertEqual(list(self.d2), [1, 9, 0, 7])
self.assertEqual(list(reversed(self.d1)), [9, 1, 7])
self.assertEqual(list(reversed(self.d2)), [7, 0, 9, 1])
def test_insert(self):
d = SortedDict()
with warnings.catch_warnings(record=True) as w: