[py-svn] r6933 - in py/dist/py/path: local svnwc test

hpk at codespeak.net hpk at codespeak.net
Thu Oct 14 19:23:13 CEST 2004


Author: hpk
Date: Thu Oct 14 19:23:07 2004
New Revision: 6933

Modified:
   py/dist/py/path/local/local.py
   py/dist/py/path/local/local_test.py
   py/dist/py/path/svnwc/command_test.py
   py/dist/py/path/test/_common.py
   py/dist/py/path/test/_svncommon.py
Log:
- shifted test_remove_file() test 

- some fixes 



Modified: py/dist/py/path/local/local.py
==============================================================================
--- py/dist/py/path/local/local.py	(original)
+++ py/dist/py/path/local/local.py	Thu Oct 14 19:23:07 2004
@@ -264,7 +264,7 @@
             else:
                 target.ensure(dir=1)
                 def rec(p):
-                    return rec.check(link=0)
+                    return p.check(link=0)
                 for x in self.visit(rec=rec): 
                     relpath = x.relto(self) 
                     newx = target.join(relpath)

Modified: py/dist/py/path/local/local_test.py
==============================================================================
--- py/dist/py/path/local/local_test.py	(original)
+++ py/dist/py/path/local/local_test.py	Thu Oct 14 19:23:07 2004
@@ -92,16 +92,6 @@
         finally:
             d.remove(rec=1)
 
-    def test_remove_file(self):
-        tempdir = local.mkdtemp()
-        try:
-            testfile = tempdir.join('test')
-            testfile.write('test')
-            testfile.remove()
-            assert not testfile.check()
-        finally:
-            tempdir.remove(rec=1)
-
     def test_ensure_filepath_withdir(self):
         tmpdir = local.mkdtemp()
         try:

Modified: py/dist/py/path/svnwc/command_test.py
==============================================================================
--- py/dist/py/path/svnwc/command_test.py	(original)
+++ py/dist/py/path/svnwc/command_test.py	Thu Oct 14 19:23:07 2004
@@ -1,5 +1,4 @@
-import sys, os
-from py import test, path, process
+import py
 from py.__impl__.path.test._svncommon import CommonSvnTests
 from py.__impl__.path.test.setuptestfs import setuptestfs
 
@@ -7,19 +6,19 @@
 # cache previously obtained wcs!
 #
 def getrepowc():
-    repo = test.config.tmpdir / 'path' / 'repo'
-    wcdir = test.config.tmpdir / 'path' / 'wc'
+    repo = py.test.config.tmpdir / 'path' / 'repo'
+    wcdir = py.test.config.tmpdir / 'path' / 'wc'
     if not repo.check():
         assert not wcdir.check()
         repo.ensure(dir=1)
         try:
-            process.cmdexec('svnadmin create %s' % repo)
-        except process.cmdexec.Error: 
+            py.process.cmdexec('svnadmin create %s' % repo)
+        except py.process.cmdexec.Error: 
             repo.remove()
-            raise test.run.Skipped(msg='could not create temporary svn test repository')
+            raise py.test.run.Skipped(msg='could not create temporary svn test repository')
         wcdir.ensure(dir=1)
         print "created svn repository", repo
-        wc = path.svnwc(wcdir, url='file://%s' % repo)
+        wc = py.path.svnwc(wcdir, url='file://%s' % repo)
         wc.checkout()
         print "checked out new repo into", wc
         setuptestfs(wc)
@@ -31,7 +30,7 @@
         wc.commit('third rev') 
     else:
         print "using repository at %s" % repo
-        wc = path.svnwc(wcdir)
+        wc = py.path.svnwc(wcdir)
     return ("file://%s" % repo, wc)
 
 class TestWCSvnCommandPath(CommonSvnTests): 

Modified: py/dist/py/path/test/_common.py
==============================================================================
--- py/dist/py/path/test/_common.py	(original)
+++ py/dist/py/path/test/_common.py	Thu Oct 14 19:23:07 2004
@@ -1,4 +1,5 @@
 from py.path import checker, NotFound
+import py 
 
 class CommonFSTests:
     root = None  # subclasses have to provide a current 'root' attribute 
@@ -322,3 +323,14 @@
         finally:
             if copied.check(dir=1):
                 copied.remove(rec=1)
+
+    def test_remove_file(self):
+        d = self.root.ensure('todeleted') 
+        assert d.check()
+        d.remove() 
+        assert not d.check() 
+
+    # !!!!
+    # don't insert any tests below because the previous test is
+    # desctructive!
+    # !!!!

Modified: py/dist/py/path/test/_svncommon.py
==============================================================================
--- py/dist/py/path/test/_svncommon.py	(original)
+++ py/dist/py/path/test/_svncommon.py	Thu Oct 14 19:23:07 2004
@@ -1,10 +1,13 @@
-import sys, os
-
+import py
 from py import path, test, process
 from py.__impl__.path.test import _common 
 from py.__impl__.path.svn import cache 
 
 class CommonSvnTests(_common.CommonFSTests):
+
+    def test_remove_file(self):
+        py.test.run.Skipped(msg="need better svn state management") 
+        
     def test_propget(self):
         url = self.root.join("samplefile")
         value = url.propget('svn:eol-style')



More information about the pytest-commit mailing list