Skip to content

Commit

Permalink
Remove code and tests for unsupported Python 2.6 (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored and methane committed Oct 12, 2017
1 parent a70ce0c commit 0fc4ee9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ msgpack/*.cpp
/venv
/tags
/docs/_build
.cache
18 changes: 2 additions & 16 deletions test/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from msgpack import packb, unpackb, Unpacker, Packer

from collections import OrderedDict
from io import BytesIO

def check(data, use_list=False):
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0fc4ee9

Please sign in to comment.