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 | |
parent | b2efa1b19061ad6ed9d683ba98a88b18bff3bfd9 (diff) | |
parent | 9e4a4545dd513204efb6afe40e4b50c3b5f77e50 (diff) | |
download | gitpython-ec731f448d304dfe1f9269cc94de405aeb3a0665.tar.gz |
Merge with #532, fix unicode filenames with escapesurogates
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/performance/test_commit.py | 2 | ||||
-rw-r--r-- | git/test/test_fun.py | 18 |
2 files changed, 12 insertions, 8 deletions
diff --git a/git/test/performance/test_commit.py b/git/test/performance/test_commit.py index c60dc2fc..322d3c9f 100644 --- a/git/test/performance/test_commit.py +++ b/git/test/performance/test_commit.py @@ -52,7 +52,7 @@ class TestPerformance(TestBigRepoRW): # END for each object # END for each commit elapsed_time = time() - st - print("Traversed %i Trees and a total of %i unchached objects in %s [s] ( %f objs/s )" + print("Traversed %i Trees and a total of %i uncached objects in %s [s] ( %f objs/s )" % (nc, no, elapsed_time, no / elapsed_time), file=sys.stderr) def test_commit_traversal(self): 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 |