Fixed some minor mocking differences in Python 2 and 3.
This commit is contained in:
1 parent
109fdc53e0
commit
2d9c644ab6
1 file changed
+7
-5
@@ -60,12 +60,14 @@ def test_carriage_return_splitting():
|
||||
|
||||
|
||||
def test_split_parts():
|
||||
def splits(source):
|
||||
class Obj(object):
|
||||
_keyword_re = FastParser._keyword_re
|
||||
number_of_splits = True
|
||||
cache.parser_cache.pop(None, None)
|
||||
|
||||
return tuple(FastParser._split_parts(Obj(), source))
|
||||
def splits(source):
|
||||
class Mock(FastParser):
|
||||
def __init__(self, *args):
|
||||
self.number_of_splits = 0
|
||||
|
||||
return tuple(FastParser._split_parts(Mock(None, None), source))
|
||||
|
||||
def test(*parts):
|
||||
assert splits(''.join(parts)) == parts
|
||||
|
||||
Reference in new issue
Block a user