]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
adjument to regexp for parsing courtesy Barry Warsaw
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 Jul 2006 21:33:03 +0000 (21:33 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 Jul 2006 21:33:03 +0000 (21:33 +0000)
lib/sqlalchemy/engine/url.py
test/engine/parseconnect.py

index 65c9f166274848dd87d30a7022bf68044fc8e5e3..bd8ee26436e68811dd3e42c9c158f8d504b3e2ee 100644 (file)
@@ -60,8 +60,8 @@ def _parse_rfc1738_args(name):
     pattern = re.compile(r'''
             (\w+)://
             (?:
-                ([^:]*)
-                (?::(.*))?
+                ([^:/]*)
+                (?::([^/]*))?
             @)?
             (?:
                 ([^/:]*)
index 43389c272cbc782faeea5fc1c8df7a7717629573..cb77d96d0df955f4ef09d75d06f8c8274b63c16b 100644 (file)
@@ -20,11 +20,16 @@ class ParseConnectTest(PersistTest):
             'dbtype:///E:/work/src/LEM/db/hello.db',
             'dbtype:///E:/work/src/LEM/db/hello.db?foo=bar&hoho=lala',
             'dbtype://',
-            'dbtype://username:password@/db'
+            'dbtype://username:password@/db',
+            'dbtype:////usr/local/mailman/lists/_xtest@example.com/members.db'
         ):
             u = url.make_url(text)
             print u, text
             print "username=", u.username, "password=", u.password,  "database=", u.database, "host=", u.host
+            assert u.drivername == 'dbtype'
+            assert u.username == 'username' or u.username is None
+            assert u.password == 'password' or u.password is None
+            assert u.host == 'hostspec' or u.host == '127.0.0.1' or (not u.host)
             assert str(u) == text