#NEWLINE# def test_validate_url( self ) : #NEWLINE# #INDENT# '\n        Check error handling for malformed url.\n        URLs must have a protocol and host; if a port is specified,\n        it must use the correct syntax.\n        ' #NEWLINE# for ( url , is_valid ) in [ ( '' , False ) , ( 'invalid' , False ) , ( '/invalid' , False ) , ( 'http://localhost:' , False ) , ( 'http://localhost:/invalid' , False ) , ( '://localhost/invalid' , False ) , ( 'http://localhost' , True ) , ( 'http://localhost/test' , True ) , ( 'http://localhost:8080' , True ) , ( 'http://localhost:8080/test' , True ) , ( 'http://user:pass@localhost/test' , True ) , ( 'http://user:pass@localhost:8080/test' , True ) ] : #NEWLINE# #INDENT# returned_val = PageObject . validate_url ( url ) #NEWLINE# self . assertEquals ( returned_val , is_valid , msg = 'Url: {0}, Expected {1} but got {2}' . format ( url , is_valid , returned_val ) )