diff --git a/tests/test_compat.py b/tests/test_compat.py index ad58f64..90b67df 100644 --- a/tests/test_compat.py +++ b/tests/test_compat.py @@ -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(): @@ -51,4 +52,17 @@ def test_urlmisc(): 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 \ No newline at end of file diff --git a/tests/test_string.py b/tests/test_string.py index 44e738f..6715995 100644 --- a/tests/test_string.py +++ b/tests/test_string.py @@ -14,6 +14,9 @@ def test_safeunicode(): assert safeunicode(1) == u'1' assert safeunicode('中文') == u'中文' + assert safeunicode(u'hello') == u'hello' + assert safeunicode(u'中文') == u'中文' + def test_lstrips(): assert lstrips('foobbar', '') == 'foobbar'