@@ -94,7 +94,8 @@ def test_url_match(self):
9494 def t (s , nothing = False , ** groups ):
9595 m = StringHTMLProperty .hyper_re .search (s )
9696 if nothing :
97- self .assertEquals (m , None , '%r matched' % s )
97+ if m :
98+ self .assertEquals (m , None , '%r matched (%r)' % (s , m .groupdict ()))
9899 return
99100 else :
100101 self .assertNotEquals (m , None , '%r did not match' % s )
@@ -104,7 +105,11 @@ def t(s, nothing=False, **groups):
104105 groups [g ], s ))
105106
106107 #t('123.321.123.321', 'url')
108+ t ('http://localhost/' , url = 'http://localhost/' )
107109 t ('http://roundup.net/' , url = 'http://roundup.net/' )
110+ t ('http://richard@localhost/' , url = 'http://richard@localhost/' )
111+ t ('http://richard:sekrit@localhost/' ,
112+ url = 'http://richard:sekrit@localhost/' )
108113 t ('<HTTP://roundup.net/>' , url = 'HTTP://roundup.net/' )
109114 t ('www.a.ex' , url = 'www.a.ex' )
110115 t ('foo.a.ex' , nothing = True )
@@ -117,6 +122,8 @@ def t(s, nothing=False, **groups):
117122 t ('r@a.com' , email = 'r@a.com' )
118123 t ('i1' , ** {'class' :'i' , 'id' :'1' })
119124 t ('item123' , ** {'class' :'item' , 'id' :'123' })
125+ t ('www.user:pass@host.net' , email = 'pass@host.net' )
126+ t ('user:pass@www.host.net' , url = 'user:pass@www.host.net' )
120127
121128 def test_url_replace (self ):
122129 p = StringHTMLProperty (self .client , 'test' , '1' , None , 'test' , '' )
0 commit comments