mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-08 05:17:15 +00:00
See ChangeLog
Monotone-Parent: 8260a03656dcb7042c36f5ed015c0e1691560468 Monotone-Revision: 11c5eefb2d127036af170d47dc0f555860e8c38a Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-10-05T19:15:14 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
3e7278ba0e
commit
5e342d5e99
6 files changed
+205
-1
No files matched your search
@@ -28,5 +28,23 @@ class HTTPUnparsedURLTest(unittest.TestCase):
|
||||
self.assertEquals(testURL.port, None)
|
||||
self.assertEquals(testURL.path, "/folder/folder/simplereference")
|
||||
|
||||
pathURL = "http://user:secret@bla.com/hooray"
|
||||
testURL = HTTPUnparsedURL(pathURL)
|
||||
self.assertEquals(testURL.protocol, "http")
|
||||
self.assertEquals(testURL.username, "user")
|
||||
self.assertEquals(testURL.password, "secret")
|
||||
self.assertEquals(testURL.hostname, "bla.com")
|
||||
self.assertEquals(testURL.port, None)
|
||||
self.assertEquals(testURL.path, "/hooray")
|
||||
|
||||
pathURL = "http://user@bla.com:80/hooray"
|
||||
testURL = HTTPUnparsedURL(pathURL)
|
||||
self.assertEquals(testURL.protocol, "http")
|
||||
self.assertEquals(testURL.username, "user")
|
||||
self.assertEquals(testURL.password, None)
|
||||
self.assertEquals(testURL.hostname, "bla.com")
|
||||
self.assertEquals(testURL.port, "80")
|
||||
self.assertEquals(testURL.path, "/hooray")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+1
-1
@@ -24,7 +24,7 @@ class HTTPUnparsedURL:
|
||||
url_parts = url.split("?")
|
||||
alpha_match = "[a-zA-Z0-9%\._-]+"
|
||||
num_match = "[0-9]+"
|
||||
pattern = ("((%s)://(((%s)(:(%s)?)@)?(%s)(:(%s))))?(/.*)"
|
||||
pattern = ("((%s)://(((%s)(:(%s))?@)?(%s)(:(%s))?))?(/.*)"
|
||||
% (alpha_match, alpha_match, alpha_match,
|
||||
alpha_match, num_match))
|
||||
url_re = re.compile(pattern)
|
||||
|
||||
Reference in new issue
Block a user