summaryrefslogtreecommitdiff
path: root/test/base/utils.py
diff options
context:
space:
mode:
authorMichael Trier <mtrier@gmail.com>2009-04-13 04:25:41 +0000
committerMichael Trier <mtrier@gmail.com>2009-04-13 04:25:41 +0000
commita7e0fdd5fcd62ebb299364f845e496b61ead55a8 (patch)
treece13f7a361208d3639723bd9f1701f51b40ade36 /test/base/utils.py
parentb5ad47271e68a30b2acd8f990af331de8e1069f3 (diff)
downloadsqlalchemy-a7e0fdd5fcd62ebb299364f845e496b61ead55a8.tar.gz
Added copy and __copy__ methods to the OrderedDict. Fixes #1377.
Diffstat (limited to 'test/base/utils.py')
-rw-r--r--test/base/utils.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/base/utils.py b/test/base/utils.py
index 0b7762b7d..bc3fc0283 100644
--- a/test/base/utils.py
+++ b/test/base/utils.py
@@ -1,5 +1,5 @@
import testenv; testenv.configure_for_tests()
-import threading, unittest
+import copy, threading, unittest
from sqlalchemy import util, sql, exc
from testlib import TestBase
from testlib.testing import eq_, is_, ne_
@@ -55,6 +55,18 @@ class OrderedDictTest(TestBase):
o = util.OrderedDict([('name', 'jbe'), ('fullname', 'jonathan'), ('password', '')])
eq_(o.keys(), ['name', 'fullname', 'password'])
+ def test_odict_copy(self):
+ o = util.OrderedDict()
+ o["zzz"] = 1
+ o["aaa"] = 2
+ eq_(o.keys(), ['zzz', 'aaa'])
+
+ o2 = o.copy()
+ eq_(o2.keys(), o.keys())
+
+ o3 = copy.copy(o)
+ eq_(o3.keys(), o.keys())
+
class OrderedSetTest(TestBase):
def test_mutators_against_iter(self):
# testing a set modified against an iterator