[py-svn] r33392 - in py/dist/py/path/svn: . testing
hpk at codespeak.net
hpk at codespeak.net
Tue Oct 17 22:04:00 CEST 2006
Author: hpk
Date: Tue Oct 17 22:03:59 2006
New Revision: 33392
Modified:
py/dist/py/path/svn/testing/test_urlcommand.py
py/dist/py/path/svn/urlcommand.py
Log:
make svnurl command initialization more specific,
it should not accept None silently, there is no
sensible default. Also we should just care
to have py.path.svnurl(py.path.svnurl(...)) work,
it's basically a copying operation now (although
there is only an indirect test for that,
constructor_equality)
Tests pass with this, although something might
break somewhere :)
Modified: py/dist/py/path/svn/testing/test_urlcommand.py
==============================================================================
--- py/dist/py/path/svn/testing/test_urlcommand.py (original)
+++ py/dist/py/path/svn/testing/test_urlcommand.py Tue Oct 17 22:03:59 2006
@@ -12,6 +12,12 @@
repo, wc = getrepowc()
cls.root = py.path.svnurl(repo)
+ def test_svnurl_needs_arg(self):
+ py.test.raises(TypeError, "py.path.svnurl()")
+
+ def test_svnurl_does_not_accept_None_either(self):
+ py.test.raises(Exception, "py.path.svnurl(None)")
+
def test_svnurl_characters_simple(self):
py.path.svnurl("svn+ssh://hello/world")
Modified: py/dist/py/path/svn/urlcommand.py
==============================================================================
--- py/dist/py/path/svn/urlcommand.py (original)
+++ py/dist/py/path/svn/urlcommand.py Tue Oct 17 22:03:59 2006
@@ -20,8 +20,9 @@
def __new__(cls, path, rev=None):
self = object.__new__(cls)
- if not isinstance(path, str):
- path = str(path)
+ if isinstance(path, cls):
+ rev = path.rev
+ path = path.strpath
proto, uri = path.split("://", 1)
host, uripath = uri.split('/', 1)
# only check for bad chars in the non-protocol parts
More information about the pytest-commit
mailing list