[svn r38116] fixing svn tests for -d runs (which usually
is a dependency problem) --HG-- branch : trunk
This commit is contained in:
parent
60455ead56
commit
3049c6bd2a
|
@ -10,21 +10,16 @@ repodump = mypath.dirpath('repotest.dump')
|
|||
# make a wc directory out of a given root url
|
||||
# cache previously obtained wcs!
|
||||
#
|
||||
def getrepowc(reponame='a~bc$aaa~', wcname='wc'):
|
||||
def getrepowc(reponame='basetestrepo', wcname='wc'):
|
||||
repo = py.test.ensuretemp(reponame)
|
||||
wcdir = py.test.ensuretemp(wcname)
|
||||
if not repo.listdir():
|
||||
#assert not wcdir.check()
|
||||
repo.ensure(dir=1)
|
||||
try:
|
||||
py.process.cmdexec('svnadmin create "%s"' %
|
||||
svncommon._escape_helper(repo))
|
||||
py.process.cmdexec('svnadmin load -q "%s" <"%s"' %
|
||||
(svncommon._escape_helper(repo), repodump))
|
||||
except py.process.cmdexec.Error:
|
||||
raise
|
||||
repo.remove()
|
||||
raise py.test.skip('could not create temporary svn test repository')
|
||||
py.process.cmdexec('svnadmin create "%s"' %
|
||||
svncommon._escape_helper(repo))
|
||||
py.process.cmdexec('svnadmin load -q "%s" <"%s"' %
|
||||
(svncommon._escape_helper(repo), repodump))
|
||||
print "created svn repository", repo
|
||||
wcdir.ensure(dir=1)
|
||||
wc = py.path.svnwc(wcdir)
|
||||
|
|
|
@ -9,11 +9,27 @@ def setup_module(mod):
|
|||
if py.path.local.sysfind('svn') is None:
|
||||
py.test.skip("cannot test py.path.svn, 'svn' binary not found")
|
||||
|
||||
class TestSvnCommandPath(CommonCommandAndBindingTests):
|
||||
class TestSvnURLCommandPath(CommonCommandAndBindingTests):
|
||||
def setup_class(cls):
|
||||
repo, wc = getrepowc()
|
||||
cls.root = py.path.svnurl(repo)
|
||||
|
||||
def test_move_file(self): # overrides base class
|
||||
p = self.root.ensure('origfile')
|
||||
newp = p.dirpath('newfile')
|
||||
p.move(newp)
|
||||
assert newp.check(file=1)
|
||||
newp.remove()
|
||||
assert not p.check()
|
||||
|
||||
def test_move_dir(self): # overrides base class
|
||||
p = self.root.ensure('origdir', dir=1)
|
||||
newp = p.dirpath('newdir')
|
||||
p.move(newp)
|
||||
assert newp.check(dir=1)
|
||||
newp.remove()
|
||||
assert not p.check()
|
||||
|
||||
def test_svnurl_needs_arg(self):
|
||||
py.test.raises(TypeError, "py.path.svnurl()")
|
||||
|
||||
|
@ -52,7 +68,9 @@ class TestSvnInfoCommand:
|
|||
assert info.last_author == 'hpk'
|
||||
assert info.created_rev == 2256
|
||||
assert info.kind == 'file'
|
||||
assert time.gmtime(info.mtime)[:6] == (2006, 11, 24, 17, 55, 0)
|
||||
# we don't check for the year (2006), because that depends
|
||||
# on the clock correctly being setup
|
||||
assert time.gmtime(info.mtime)[1:6] == (11, 24, 17, 55, 0)
|
||||
assert info.size == 165
|
||||
assert info.time == info.mtime * 1000000
|
||||
|
||||
|
|
|
@ -14,6 +14,18 @@ class TestWCSvnCommandPath(CommonSvnTests):
|
|||
def setup_class(cls):
|
||||
repo, cls.root = getrepowc()
|
||||
|
||||
def test_move_file(self): # overrides base class
|
||||
try:
|
||||
super(TestWCSvnCommandPath, self).test_move_file()
|
||||
finally:
|
||||
self.root.revert(rec=1)
|
||||
|
||||
def test_move_directory(self): # overrides base class
|
||||
try:
|
||||
super(TestWCSvnCommandPath, self).test_move_directory()
|
||||
finally:
|
||||
self.root.revert(rec=1)
|
||||
|
||||
def test_status_attributes_simple(self):
|
||||
def assert_nochange(p):
|
||||
s = p.status()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from py.__.path.common import checker
|
||||
import py
|
||||
|
||||
class CommonPathTests:
|
||||
class CommonPathTests(object):
|
||||
root = None # subclasses have to setup a 'root' attribute
|
||||
|
||||
def test_constructor_equality(self):
|
||||
|
|
Loading…
Reference in New Issue