From 9e4a4545dd513204efb6afe40e4b50c3b5f77e50 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 16 Oct 2016 15:09:38 +0200 Subject: fix(surrogateescape): enable on py2, fix tests --- git/test/test_fun.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'git/test/test_fun.py') 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 -- cgit v1.2.1