summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMitar <mitar.git@tnode.com>2012-10-15 12:12:10 -0700
committerMitar <mitar.git@tnode.com>2012-10-15 12:12:10 -0700
commit2811e543c648a0669c88185a4d117eeb8ff09689 (patch)
tree7fe8e34f605e14ca4874b370f083abc1513e1bbf /tests
parentc3fabb282d429de931ef10c91cee55700578eb86 (diff)
Added tests for reversed iteration over SortedDict.
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/utils/datastructures.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/utils/datastructures.py b/tests/regressiontests/utils/datastructures.py
index dbc65d37a8..7c81ccd172 100644
--- a/tests/regressiontests/utils/datastructures.py
+++ b/tests/regressiontests/utils/datastructures.py
@@ -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: