Author: mark
Date: 2008-05-20 07:22:12 -0600 (Tue, 20 May 2008)
New Revision: 3438
Modified:
FormEncode/trunk/formencode/validators.py
Log:
additional tests for URL validator to increase test coverage
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2008-05-20 12:47:03 UTC (rev
3437)
+++ FormEncode/trunk/formencode/validators.py 2008-05-20 13:22:12 UTC (rev
3438)
@@ -1374,11 +1374,21 @@
'http://foo.com'
>>> u.to_python('http://hahaha/bar.html')
'http://hahaha/bar.html'
+ >>> u.to_python('http://xn--m7r7ml7t24h.com')
+ 'http://xn--m7r7ml7t24h.com'
>>> u.to_python('https://test.com')
'https://test.com'
+ >>> u.to_python('http://test..com')
+ Traceback (most recent call last):
+ ...
+ Invalid: That is not a valid URL
>>> u = URL(add_http=False, check_exists=True)
>>> u.to_python('http://google.com')
'http://google.com'
+ >>> u.to_python('google.com')
+ Traceback (most recent call last):
+ ...
+ Invalid: You must start your URL with http://, https://, etc
>>> u.to_python('http://colorstudy.com/doesnotexist.html')
Traceback (most recent call last):
...
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs