Commits

sgillies  committed 35233d8

Check that input starts with 'geo:'

  • Participants
  • Parent commits 37ac6bf

Comments (0)

Files changed (2)

File geouri/__init__.py

                 self.u = float(p[2:])
 
 def parse(uri):
-    if not uri.startswith('geo'):
+    if not uri.startswith('geo:'):
         raise ValueError, "Not a 'geo' URI"
     return ParseResult(uri[4:])
     

File geouri/tests.py

         self.failUnlessEqual(r.u, 10.0)
     def test_scheme(self):
         self.assertRaises(ValueError, parse, 'http://0.0,1.0;crs=foo;u=10.0')
+    def test_scheme2(self):
+        self.assertRaises(ValueError, parse, 'geo0.0,1.0;crs=foo;u=10.0')
     
 class TestFrom(unittest.TestCase):
     def test_1(self):