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

Commit725bde9

Browse files
committed
test_base works
1 parent95bb489 commit725bde9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎git/test/test_base.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#
55
# This module is part of GitPython and is released under
66
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
7-
8-
importgit.objects.baseasbase
97
importos
8+
importtempfile
109

10+
importgit.objects.baseasbase
1111
fromgit.test.libimport (
1212
TestBase,
1313
assert_raises,
@@ -69,10 +69,13 @@ def test_base_object(self):
6969
data=data_stream.read()
7070
assertdata
7171

72-
tmpfile=os.tmpfile()
72+
tmpfilename=tempfile.mktemp(suffix='test-stream')
73+
tmpfile=open(tmpfilename,'wb+')
7374
assertitem==item.stream_data(tmpfile)
7475
tmpfile.seek(0)
7576
asserttmpfile.read()==data
77+
tmpfile.close()
78+
os.remove(tmpfilename)
7679
# END stream to file directly
7780
# END for each object type to create
7881

@@ -113,7 +116,7 @@ def test_add_unicode(self, rw_repo):
113116
filename=u"שלום.txt"
114117

115118
file_path=os.path.join(rw_repo.working_dir,filename)
116-
open(file_path,"wb").write('something')
119+
open(file_path,"wb").write(b'something')
117120

118121
rw_repo.git.add(rw_repo.working_dir)
119122
rw_repo.index.commit('message')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp