add compat test case

This commit is contained in:
agnewee 2017-12-04 23:55:44 +08:00
parent a72791507f
commit 0c81bbd693
1 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,7 @@
from pydu.compat import (PY2, iterkeys, itervalues, iteritems,
text_type, string_types, numeric_types,
is_iterable, has_next_attr)
is_iterable, has_next_attr, urljoin,
imap)
def test_itersth():
@ -47,8 +48,21 @@ def test_types():
def test_urljoin():
from pydu.compat import urljoin
assert 'http://uyun.cn/test' == urljoin('http://uyun.cn', 'test')
def test_imap():
from pydu.compat import imap
assert list(imap(pow, (2, 3, 10), (5, 2, 3))) == [32, 9, 1000]
assert list(imap(max, (1, 4, 7), (2, 3, 8))) == [2, 4, 8]
# TODO: add test case
def test_ulib():
from pydu.compat import ulib
pass
# TODO: add test case
def test_urlparse():
from pydu.compat import urlparse
pass