summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHugo <hugovk@users.noreply.github.com>2017-10-12 10:27:39 +0300
committerINADA Naoki <methane@users.noreply.github.com>2017-10-12 16:27:39 +0900
commit0fc4ee98be498f39a320eff501ba30c49c31482d (patch)
tree03c2630492a792db189f6bcc78ae33bf73fa47f2 /test
parenta70ce0c3d7bb25646302fd2649ba916178cf4a69 (diff)
downloadmsgpack-python-0fc4ee98be498f39a320eff501ba30c49c31482d.tar.gz
Remove code and tests for unsupported Python 2.6 (#250)
Diffstat (limited to 'test')
-rw-r--r--test/test_pack.py18
1 files changed, 2 insertions, 16 deletions
diff --git a/test/test_pack.py b/test/test_pack.py
index a704fdb..ac93103 100644
--- a/test/test_pack.py
+++ b/test/test_pack.py
@@ -7,6 +7,7 @@ from pytest import raises, xfail
from msgpack import packb, unpackb, Unpacker, Packer
+from collections import OrderedDict
from io import BytesIO
def check(data, use_list=False):
@@ -136,24 +137,9 @@ def testMapSize(sizes=[0, 5, 50, 1000]):
assert unpacker.unpack() == dict((i, i * 2) for i in range(size))
-class odict(dict):
- """Reimplement OrderedDict to run test on Python 2.6"""
- def __init__(self, seq):
- self._seq = seq
- dict.__init__(self, seq)
-
- def items(self):
- return self._seq[:]
-
- def iteritems(self):
- return iter(self._seq)
-
- def keys(self):
- return [x[0] for x in self._seq]
-
def test_odict():
seq = [(b'one', 1), (b'two', 2), (b'three', 3), (b'four', 4)]
- od = odict(seq)
+ od = OrderedDict(seq)
assert unpackb(packb(od), use_list=1) == dict(seq)
def pair_hook(seq):
return list(seq)