diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2012-04-30 17:12:38 +0300 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2012-04-30 17:19:55 +0300 |
| commit | 4b11762f7d7aed2f4f36c4158326c0a4332038f9 (patch) | |
| tree | 360d399427cd79f4bd918e3d5226e4eef7c2dcc5 /tests | |
| parent | aa1aa1ad410c640ff22260b9c6bf3c36be98ff8e (diff) | |
Fixed SortedDict.__copy__()
Fixed #18175 -- Calling SortedDict.__copy__() resulted in changes to
the original dictionary. The reason was likely related to subclassing
dict.
Thanks to linovia for report and patch.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/utils/datastructures.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/utils/datastructures.py b/tests/regressiontests/utils/datastructures.py index d6db991007..000f7f76a1 100644 --- a/tests/regressiontests/utils/datastructures.py +++ b/tests/regressiontests/utils/datastructures.py @@ -111,6 +111,12 @@ class SortedDictTests(SimpleTestCase): {7: 'seven', 1: 'one', 9: 'nine'} ) + def test_copy(self): + orig = SortedDict(((1, "one"), (0, "zero"), (2, "two"))) + copied = copy.copy(orig) + self.assertEqual(orig.keys(), [1, 0, 2]) + self.assertEqual(copied.keys(), [1, 0, 2]) + def test_clear(self): self.d1.clear() self.assertEqual(self.d1, {}) |
