Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added tests for reversed iteration over SortedDict.

  • Loading branch information...
commit 2811e543c648a0669c88185a4d117eeb8ff09689 1 parent c3fabb2
Mitar authored October 15, 2012
6  tests/regressiontests/utils/datastructures.py
@@ -128,6 +128,12 @@ def test_clear(self):
128 128
         self.assertEqual(self.d1, {})
129 129
         self.assertEqual(self.d1.keyOrder, [])
130 130
 
  131
+    def test_reversed(self):
  132
+        self.assertEqual(list(self.d1), [7, 1, 9])
  133
+        self.assertEqual(list(self.d2), [1, 9, 0, 7])
  134
+        self.assertEqual(list(reversed(self.d1)), [9, 1, 7])
  135
+        self.assertEqual(list(reversed(self.d2)), [7, 0, 9, 1])
  136
+
131 137
     def test_insert(self):
132 138
         d = SortedDict()
133 139
         with warnings.catch_warnings(record=True) as w:

0 notes on commit 2811e54

Please sign in to comment.
Something went wrong with that request. Please try again.