[py-svn] r8047 - in py/dist/py/path: svn test

hpk at codespeak.net hpk at codespeak.net
Mon Jan 3 12:33:53 CET 2005


Author: hpk
Date: Mon Jan  3 12:33:52 2005
New Revision: 8047

Modified:
   py/dist/py/path/svn/test_urlcommand.py
   py/dist/py/path/svn/test_wccommand.py
   py/dist/py/path/svn/urlcommand.py
   py/dist/py/path/svn/wccommand.py
   py/dist/py/path/test/fscommon.py
Log:
a couple of small fixes and better error handling 
(uniform py.error.EEXIST for mkdir() and possibly others) 



Modified: py/dist/py/path/svn/test_urlcommand.py
==============================================================================
--- py/dist/py/path/svn/test_urlcommand.py	(original)
+++ py/dist/py/path/svn/test_urlcommand.py	Mon Jan  3 12:33:52 2005
@@ -1,7 +1,7 @@
 import sys, os
 import py
-from py.__impl__.path.svn.svntestbase import CommonCommandAndBindingTests 
-from py.__impl__.path.svn.test_wccommand import getrepowc 
+from svntestbase import CommonCommandAndBindingTests 
+from test_wccommand import getrepowc 
 
 class TestSvnCommandPath(CommonCommandAndBindingTests):
     def __init__(self):

Modified: py/dist/py/path/svn/test_wccommand.py
==============================================================================
--- py/dist/py/path/svn/test_wccommand.py	(original)
+++ py/dist/py/path/svn/test_wccommand.py	Mon Jan  3 12:33:52 2005
@@ -1,5 +1,5 @@
 import py
-from py.__impl__.path.svn.svntestbase import CommonSvnTests
+from svntestbase import CommonSvnTests
 from py.__impl__.path.test.fscommon import setuptestfs 
 
 # make a wc directory out of a given root url

Modified: py/dist/py/path/svn/urlcommand.py
==============================================================================
--- py/dist/py/path/svn/urlcommand.py	(original)
+++ py/dist/py/path/svn/urlcommand.py	Mon Jan  3 12:33:52 2005
@@ -53,7 +53,12 @@
         # fixing the locale because we can't otherwise parse
         string = svncommon.fixlocale() + " ".join(l)
         #print "execing", string
-        out = process.cmdexec(string)
+        try: 
+            out = process.cmdexec(string)
+        except py.process.cmdexec.Error, e: 
+            if e.err.find('File Exists'): 
+                raise py.error.EEXIST(self) 
+            raise 
         return out
 
     def open(self, mode='r'):

Modified: py/dist/py/path/svn/wccommand.py
==============================================================================
--- py/dist/py/path/svn/wccommand.py	(original)
+++ py/dist/py/path/svn/wccommand.py	Mon Jan  3 12:33:52 2005
@@ -62,7 +62,12 @@
         string = svncommon.fixlocale() + " ".join(l)
         if DEBUG:
             print "execing", string
-        out = py.process.cmdexec(string)
+        try: 
+            out = py.process.cmdexec(string)
+        except py.process.cmdexec.Error, e: 
+            if e.err.find('File Exists'): 
+                raise py.error.EEXIST(self) 
+            raise
         return out
 
     def checkout(self, url=None, rev = None): 

Modified: py/dist/py/path/test/fscommon.py
==============================================================================
--- py/dist/py/path/test/fscommon.py	(original)
+++ py/dist/py/path/test/fscommon.py	Mon Jan  3 12:33:52 2005
@@ -185,6 +185,7 @@
 
     def test_mkdir_and_remove(self):
         tmpdir = self.root 
+        py.test.raises(py.error.EEXIST, tmpdir.mkdir, 'sampledir') 
         new = tmpdir.join('mktest1')
         new.mkdir()
         assert new.check(dir=1)



More information about the pytest-commit mailing list