Skip to content

Commit 725bde9

Browse files
committed
test_base works
1 parent 95bb489 commit 725bde9

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-
import git.objects.base as base
97
import os
8+
import tempfile
109

10+
import git.objects.base as base
1111
from git.test.lib import (
1212
TestBase,
1313
assert_raises,
@@ -69,10 +69,13 @@ def test_base_object(self):
6969
data = data_stream.read()
7070
assert data
7171

72-
tmpfile = os.tmpfile()
72+
tmpfilename = tempfile.mktemp(suffix='test-stream')
73+
tmpfile = open(tmpfilename, 'wb+')
7374
assert item == item.stream_data(tmpfile)
7475
tmpfile.seek(0)
7576
assert tmpfile.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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy