summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-10-22 00:52:54 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-10-22 00:52:54 +0000
commitdbd1cb9083db8a0206a4b951813f4c8291afa824 (patch)
treee5d430cd8ff4721810824f2bd7c161c46a2643eb /tests/regressiontests
parent375a6d78cb476f865fe5cccbf3277af7afb4d719 (diff)
Fixed #5183 -- Added __deepcopy__, pop() and popitem() to SortedDict. Based on
a patch from David Blewett. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6593 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/datastructures/tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py
index b58ee79693..d1e21e673c 100644
--- a/tests/regressiontests/datastructures/tests.py
+++ b/tests/regressiontests/datastructures/tests.py
@@ -54,6 +54,17 @@
True
>>> print repr(d)
{'one': 'not one', 'two': 'two', 'three': 'three'}
+>>> d.pop('one', 'missing')
+'not one'
+>>> d.pop('one', 'missing')
+'missing'
+
+We don't know which item will be popped in popitem(), so we'll just check that
+the number of keys has decreased.
+>>> l = len(d)
+>>> _ = d.popitem()
+>>> l - len(d)
+1
Init from sequence of tuples
>>> d = SortedDict((