diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-16 19:25:20 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-16 19:25:20 +0200 |
commit | ec731f448d304dfe1f9269cc94de405aeb3a0665 (patch) | |
tree | 86c9da1d65c79f271521b3efe525cfb339020457 /git/test/test_fun.py | |
parent | b2efa1b19061ad6ed9d683ba98a88b18bff3bfd9 (diff) | |
parent | 9e4a4545dd513204efb6afe40e4b50c3b5f77e50 (diff) | |
download | gitpython-ec731f448d304dfe1f9269cc94de405aeb3a0665.tar.gz |
Merge with #532, fix unicode filenames with escapesurogates
Diffstat (limited to 'git/test/test_fun.py')
-rw-r--r-- | git/test/test_fun.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/git/test/test_fun.py b/git/test/test_fun.py index 3be25e3e..9d436653 100644 --- a/git/test/test_fun.py +++ b/git/test/test_fun.py @@ -1,10 +1,8 @@ from io import BytesIO -from stat import ( - S_IFDIR, - S_IFREG, - S_IFLNK -) +from stat import S_IFDIR, S_IFREG, S_IFLNK +from unittest.case import skipIf +from git.compat import PY3 from git.index import IndexFile from git.index.fun import ( aggressive_tree_merge @@ -253,6 +251,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 == [('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, b'\x9f')], r + assert r == [(b'aaa', 33188, '\udc9f')], r |