[Zodb-checkins] CVS: StandaloneZConfig/ZConfig/tests - test_loader.py:1.24

Fred L. Drake, Jr. fred at zope.com
Thu Feb 5 12:03:08 EST 2004


Update of /cvs-repository/StandaloneZConfig/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv16683/ZConfig/tests

Modified Files:
	test_loader.py 
Log Message:
improve exception messages for resources that cannot be opened


=== StandaloneZConfig/ZConfig/tests/test_loader.py 1.23 => 1.24 ===
--- StandaloneZConfig/ZConfig/tests/test_loader.py:1.23	Fri Jan  2 01:03:09 2004
+++ StandaloneZConfig/ZConfig/tests/test_loader.py	Thu Feb  5 12:03:05 2004
@@ -220,6 +220,22 @@
             ZConfig.url.urldefrag("file:/abc/def#frag"),
             ("file:///abc/def", "frag"))
 
+    def test_isPath(self):
+        assert_ = self.assert_
+        isPath = ZConfig.loader.BaseLoader().isPath
+        assert_(isPath("abc"))
+        assert_(isPath("abc/def"))
+        assert_(isPath("/abc"))
+        assert_(isPath("/abc/def"))
+        assert_(isPath(r"\abc"))
+        assert_(isPath(r"\abc\def"))
+        assert_(isPath(r"c:\abc\def"))
+        assert_(not isPath("http://www.example.com/"))
+        assert_(not isPath("http://www.example.com/sample.conf"))
+        assert_(not isPath("file:///etc/zope/zope.conf"))
+        assert_(not isPath("file:///c|/foo/bar.conf"))
+
+
 class TestNonExistentResources(unittest.TestCase):
 
     # XXX Not sure if this is the best approach for these.  These




More information about the Zodb-checkins mailing list