diff --git a/py/impl/path/cacheutil.py b/py/impl/path/cacheutil.py index f10ba8cc2..bac07a981 100644 --- a/py/impl/path/cacheutil.py +++ b/py/impl/path/cacheutil.py @@ -16,6 +16,9 @@ class BasicCache(object): self.prunenum = int(maxentries - maxentries/8) self._dict = {} + def clear(self): + self._dict.clear() + def _getentry(self, key): return self._dict[key] diff --git a/py/impl/path/svnurl.py b/py/impl/path/svnurl.py index 4ef3b655a..3981326ab 100644 --- a/py/impl/path/svnurl.py +++ b/py/impl/path/svnurl.py @@ -213,6 +213,17 @@ checkin message msg.""" lines = [x.strip() for x in lines[1:]] return svncommon.PropListDict(self, lines) + def info(self): + """ return an Info structure with svn-provided information. """ + parent = self.dirpath() + nameinfo_seq = parent._listdir_nameinfo() + bn = self.basename + for name, info in nameinfo_seq: + if name == bn: + return info + raise py.error.ENOENT(self) + + def _listdir_nameinfo(self): """ return sequence of name-info directory entries of self """ def builder(): diff --git a/py/impl/path/svnwc.py b/py/impl/path/svnwc.py index 4cafbff9c..4d9571c48 100644 --- a/py/impl/path/svnwc.py +++ b/py/impl/path/svnwc.py @@ -235,16 +235,6 @@ class SvnPathBase(common.PathBase): content = self._proplist() return content - def info(self): - """ return an Info structure with svn-provided information. """ - parent = self.dirpath() - nameinfo_seq = parent._listdir_nameinfo() - bn = self.basename - for name, info in nameinfo_seq: - if name == bn: - return info - raise py.error.ENOENT(self) - def size(self): """ Return the size of the file content of the Path. """ return self.info().size diff --git a/testing/path/common.py b/testing/path/common.py index 2ac18ffd9..8e83e45f6 100644 --- a/testing/path/common.py +++ b/testing/path/common.py @@ -378,7 +378,7 @@ class CommonFSTests(object): newp.move(p) assert p.check() - def test_move_directory(self, path1): + def test_move_dir(self, path1): source = path1.join('sampledir') dest = path1.join('moveddir') source.move(dest) diff --git a/testing/path/conftest.py b/testing/path/conftest.py index a51542ff2..326d0852d 100644 --- a/testing/path/conftest.py +++ b/testing/path/conftest.py @@ -76,3 +76,5 @@ def restore_repowc(obj): repo.remove() savedrepo.move(repo) savedwc.localpath.move(wc.localpath) + py.path.svnurl._lsnorevcache.clear() + py.path.svnurl._lsrevcache.clear() diff --git a/testing/path/test_cacheutil.py b/testing/path/test_cacheutil.py index 38ca4fcf5..0c9f0a526 100644 --- a/testing/path/test_cacheutil.py +++ b/testing/path/test_cacheutil.py @@ -22,6 +22,9 @@ class BasicCacheAPITest: self.cache.delentry(100) py.test.raises(KeyError, "self.cache.delentry(100, raising=True)") + def test_clear(self): + self.cache.clear() + class TestBuildcostAccess(BasicCacheAPITest): cache = cacheutil.BuildcostAccessCache(maxentries=128) diff --git a/testing/path/test_svnurl.py b/testing/path/test_svnurl.py index 0a608ab9d..4889b2dc7 100644 --- a/testing/path/test_svnurl.py +++ b/testing/path/test_svnurl.py @@ -13,22 +13,6 @@ class TestSvnURLCommandPath(CommonSvnTests): def test_load(self, path1): super(TestSvnURLCommandPath, self).test_load(path1) - def test_move_file(self, path1): # overrides base class - p = path1.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, path1): # overrides base class - p = path1.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, path1): py.test.raises(TypeError, "py.path.svnurl()") diff --git a/testing/path/test_svnwc.py b/testing/path/test_svnwc.py index 93d900d33..1d9e083a4 100644 --- a/testing/path/test_svnwc.py +++ b/testing/path/test_svnwc.py @@ -28,18 +28,6 @@ def pytest_funcarg__path1(request): return wc class TestWCSvnCommandPath(CommonSvnTests): - def test_move_file(self, path1): # overrides base class - try: - super(TestWCSvnCommandPath, self).test_move_file(path1) - finally: - path1.revert(rec=1) - - def test_move_directory(self, path1): # overrides base class - try: - super(TestWCSvnCommandPath, self).test_move_directory(path1) - finally: - path1.revert(rec=1) - def test_status_attributes_simple(self, path1): def assert_nochange(p): s = p.status()