1+ #-*-coding:utf-8-*-
12# test_git.py
23# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
34#
@@ -32,12 +33,12 @@ def test_call_process_calls_execute(self, git):
3233assert_equal (git .call_args , ((['git' ,'version' ],), {}))
3334
3435def test_call_unpack_args_unicode (self ):
35- args = Git ._Git__unpack_args (u'Unicode' + unichr ( 40960 ) )
36- assert_equal (args , ['Unicode\xea \x80 \x80 ' ])
36+ args = Git ._Git__unpack_args (u'Unicode€™' )
37+ assert_equal (args , [b 'Unicode\xe2 \x82 \xac \xe2 \x84 \xa2 ' ])
3738
3839def test_call_unpack_args (self ):
39- args = Git ._Git__unpack_args (['git' ,'log' ,'--' ,u'Unicode' + unichr ( 40960 ) ])
40- assert_equal (args , ['git' ,'log' ,'--' ,'Unicode\xea \x80 \x80 ' ])
40+ args = Git ._Git__unpack_args (['git' ,'log' ,'--' ,u'Unicode€™' ])
41+ assert_equal (args , [b 'git' ,b 'log' ,b '--' ,b 'Unicode\xe2 \x82 \xac \xe2 \x84 \xa2 ' ])
4142
4243@raises (GitCommandError )
4344def test_it_raises_errors (self ):
@@ -75,13 +76,13 @@ def test_persistent_cat_file_command(self):
7576import subprocess as sp
7677hexsha = "b2339455342180c7cc1e9bba3e9f181f7baa5167"
7778g = self .git .cat_file (batch_check = True ,istream = sp .PIPE ,as_process = True )
78- g .stdin .write ("b2339455342180c7cc1e9bba3e9f181f7baa5167\n " )
79+ g .stdin .write (b "b2339455342180c7cc1e9bba3e9f181f7baa5167\n " )
7980g .stdin .flush ()
8081obj_info = g .stdout .readline ()
8182
8283# read header + data
8384g = self .git .cat_file (batch = True ,istream = sp .PIPE ,as_process = True )
84- g .stdin .write ("b2339455342180c7cc1e9bba3e9f181f7baa5167\n " )
85+ g .stdin .write (b "b2339455342180c7cc1e9bba3e9f181f7baa5167\n " )
8586g .stdin .flush ()
8687obj_info_two = g .stdout .readline ()
8788assert obj_info == obj_info_two
@@ -92,7 +93,7 @@ def test_persistent_cat_file_command(self):
9293g .stdout .read (1 )
9394
9495# now we should be able to read a new object
95- g .stdin .write ("b2339455342180c7cc1e9bba3e9f181f7baa5167\n " )
96+ g .stdin .write (b "b2339455342180c7cc1e9bba3e9f181f7baa5167\n " )
9697g .stdin .flush ()
9798assert g .stdout .readline ()== obj_info
9899