diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-28 22:47:25 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-28 22:47:25 +0000 |
| commit | 0b185fc84f32c153239fd42a219b5a3a8e56ebda (patch) | |
| tree | c833d2d9be9d4115797bdd2884a4066ee5f9466f /test/base/test_utils.py | |
| parent | bf163f02378e5e3523c28f16c09d39a8a0dd90d2 (diff) | |
| download | sqlalchemy-0b185fc84f32c153239fd42a219b5a3a8e56ebda.tar.gz | |
- make frozendict serializable
- serialize tests use HIGHEST_PROTOCOL
Diffstat (limited to 'test/base/test_utils.py')
| -rw-r--r-- | test/base/test_utils.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/base/test_utils.py b/test/base/test_utils.py index 5377daedd..9321c888f 100644 --- a/test/base/test_utils.py +++ b/test/base/test_utils.py @@ -77,6 +77,26 @@ class OrderedSetTest(TestBase): eq_(o.intersection(iter([3,4, 6])), util.OrderedSet([3, 4])) eq_(o.union(iter([3,4, 6])), util.OrderedSet([2, 3, 4, 5, 6])) +class FrozenDictTest(TestBase): + def test_serialize(self): + + picklers = set() + try: + import cPickle + picklers.add(cPickle) + except ImportError: + pass + import pickle + picklers.add(pickle) + + d = util.frozendict({1:2, 3:4}) + + # yes, this thing needs this much testing + for pickle in picklers: + for protocol in -1, 0, 1, 2: + print pickle.loads(pickle.dumps(d, protocol)) + + class ColumnCollectionTest(TestBase): def test_in(self): cc = sql.ColumnCollection() |
