44# This module is part of GitPython and is released under
55# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
7- import os
7+ import os , sys
88import time
99from test .testlib import *
1010from git import *
@@ -15,7 +15,10 @@ def setup(self):
1515
1616 @raises (InvalidGitRepositoryError )
1717 def test_new_should_raise_on_invalid_repo_location (self ):
18- Repo ("/tmp" )
18+ if sys .platform == "win32" :
19+ Repo ("C:\\ WINDOWS\\ Temp" )
20+ else :
21+ Repo ("/tmp" )
1922
2023 @raises (NoSuchPathError )
2124 def test_new_should_raise_on_non_existant_path (self ):
@@ -141,7 +144,8 @@ def test_fork_bare(self, repo, git):
141144 self .repo .fork_bare ("repos/foo/bar.git" )
142145
143146 assert_true (git .called )
144- assert_equal (git .call_args , (('clone' , '%s/.git' % absolute_project_path (), 'repos/foo/bar.git' ), {'bare' : True }))
147+ path = os .path .join (absolute_project_path (), '.git' )
148+ assert_equal (git .call_args , (('clone' , path , 'repos/foo/bar.git' ), {'bare' : True }))
145149 assert_true (repo .called )
146150
147151 @patch (Repo , '__init__' )
@@ -152,7 +156,8 @@ def test_fork_bare_with_options(self, repo, git):
152156 self .repo .fork_bare ("repos/foo/bar.git" , ** {'template' : '/awesome' })
153157
154158 assert_true (git .called )
155- assert_equal (git .call_args , (('clone' , '%s/.git' % absolute_project_path (), 'repos/foo/bar.git' ),
159+ path = os .path .join (absolute_project_path (), '.git' )
160+ assert_equal (git .call_args , (('clone' , path , 'repos/foo/bar.git' ),
156161 {'bare' : True , 'template' : '/awesome' }))
157162 assert_true (repo .called )
158163
@@ -246,7 +251,8 @@ def test_alternates_setter_empty(self, os):
246251 assert_true (os .called )
247252
248253 def test_repr (self ):
249- assert_equal ('<GitPython.Repo "%s/.git">' % os .path .abspath (GIT_REPO ), repr (self .repo ))
254+ path = os .path .join (os .path .abspath (GIT_REPO ), '.git' )
255+ assert_equal ('<GitPython.Repo "%s">' % path , repr (self .repo ))
250256
251257 @patch (Git , '_call_process' )
252258 def test_log (self , git ):
0 commit comments