Skip to content

Commit c8cf69b

Browse files
committed
Fixed test_git once again
1 parent 1527b57 commit c8cf69b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

git/test/test_git.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
from git import (Git,
1818
GitCommandError)
1919

20+
from git.compat import PY3
21+
2022

2123
class TestGit(TestBase):
2224

@@ -34,11 +36,19 @@ def test_call_process_calls_execute(self, git):
3436

3537
def test_call_unpack_args_unicode(self):
3638
args = Git._Git__unpack_args(u'Unicode€™')
37-
assert_equal(args, ['Unicode\u20ac\u2122'])
39+
if PY3:
40+
mangled_value = 'Unicode\u20ac\u2122'
41+
else:
42+
mangled_value = 'Unicode\xe2\x82\xac\xe2\x84\xa2'
43+
assert_equal(args, [mangled_value])
3844

3945
def test_call_unpack_args(self):
4046
args = Git._Git__unpack_args(['git', 'log', '--', u'Unicode€™'])
41-
assert_equal(args, ['git', 'log', '--', 'Unicode\u20ac\u2122'])
47+
if PY3:
48+
mangled_value = 'Unicode\u20ac\u2122'
49+
else:
50+
mangled_value = 'Unicode\xe2\x82\xac\xe2\x84\xa2'
51+
assert_equal(args, ['git', 'log', '--', mangled_value])
4252

4353
@raises(GitCommandError)
4454
def test_it_raises_errors(self):

0 commit comments

Comments
 (0)