diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2016-10-16 15:09:38 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2016-10-16 15:09:38 +0200 |
commit | 9e4a4545dd513204efb6afe40e4b50c3b5f77e50 (patch) | |
tree | 54ffff6c8dba0410693673caa38124a704ac9224 /git/test/test_fun.py | |
parent | 93d530234a4f5533aa99c3b897bb56d375c2ae60 (diff) | |
download | gitpython-9e4a4545dd513204efb6afe40e4b50c3b5f77e50.tar.gz |
fix(surrogateescape): enable on py2, fix tests
Diffstat (limited to 'git/test/test_fun.py')
-rw-r--r-- | git/test/test_fun.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/git/test/test_fun.py b/git/test/test_fun.py index 40d040b9..02f338dd 100644 --- a/git/test/test_fun.py +++ b/git/test/test_fun.py @@ -16,7 +16,9 @@ from git.index.fun import ( from gitdb.util import bin_to_hex from gitdb.base import IStream from gitdb.typ import str_tree_type +from git.compat import PY3 +from unittest.case import skipIf from stat import ( S_IFDIR, S_IFREG, @@ -256,6 +258,12 @@ class TestFun(TestBase): assert entries # END for each commit - def test_tree_entries_from_data_with_failing_name_decode(self): + @skipIf(PY3, 'odd types returned ... maybe figure it out one day') + def test_tree_entries_from_data_with_failing_name_decode_py2(self): r = tree_entries_from_data(b'100644 \x9f\0aaa') - assert r == [(b'aaa', 33188, b'\x9f')], r + assert r == [('aaa', 33188, u'\udc9f')], r + + @skipIf(not PY3, 'odd types returned ... maybe figure it out one day') + def test_tree_entries_from_data_with_failing_name_decode_py3(self): + r = tree_entries_from_data(b'100644 \x9f\0aaa') + assert r == [(b'aaa', 33188, '\udc9f')], r |