Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7297ff6

Browse files
committed
test_git works
1 parent4a67e4e commit7297ff6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

‎git/test/test_git.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
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):
3233
assert_equal(git.call_args, ((['git','version'],), {}))
3334

3435
deftest_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

3839
deftest_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)
4344
deftest_it_raises_errors(self):
@@ -75,13 +76,13 @@ def test_persistent_cat_file_command(self):
7576
importsubprocessassp
7677
hexsha="b2339455342180c7cc1e9bba3e9f181f7baa5167"
7778
g=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")
7980
g.stdin.flush()
8081
obj_info=g.stdout.readline()
8182

8283
# read header + data
8384
g=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")
8586
g.stdin.flush()
8687
obj_info_two=g.stdout.readline()
8788
assertobj_info==obj_info_two
@@ -92,7 +93,7 @@ def test_persistent_cat_file_command(self):
9293
g.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")
9697
g.stdin.flush()
9798
assertg.stdout.readline()==obj_info
9899

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp