Beispiel #1
0
 def test_parser_simple_link(self):
     response = HTTPResponse(200, '<a href="/index.aspx">ASP.NET</a>',
                             Headers(), self.url, self.url)
     w = WMLParser(response)
     re, parsed = w.get_references()
     
     # TODO: Shouldn't this be the other way around?!
     self.assertEqual(len(parsed), 0)
     self.assertEqual(u'http://www.w3af.com/index.aspx', re[0].url_string)
Beispiel #2
0
 def test_parser_simple_link(self):
     response = HTTPResponse( 200, '<a href="/index.aspx">ASP.NET</a>', 
                              Headers(), self.url, self.url )
     w = WMLParser( response )
     re, parsed = w.get_references()
     
     # TODO: Shouldn't this be the other way around?!
     self.assertEqual(len(parsed), 0)
     self.assertEqual(u'http://www.w3af.com/index.aspx', re[0].url_string)
Beispiel #3
0
 def test_parser_re_link(self):
     """Get a link by applying regular expressions"""
     response = HTTPResponse(200, 'header /index.aspx footer',
                             Headers(), self.url, self.url)
     w = WMLParser( response )
     re, parsed = w.get_references()
     
     # TODO: Shouldn't this be the other way around?!
     self.assertEqual([], re)
     self.assertEqual(len(parsed), 1)
     self.assertEqual(u'http://www.w3af.com/index.aspx', parsed[0].url_string)
Beispiel #4
0
    def test_parser_re_link(self):
        """Get a link by applying regular expressions"""
        response = HTTPResponse(200, 'header /index.aspx footer', Headers(),
                                self.url, self.url)
        w = WMLParser(response)
        re, parsed = w.get_references()

        # TODO: Shouldn't this be the other way around?!
        self.assertEqual([], re)
        self.assertEqual(len(parsed), 1)
        self.assertEqual(u'http://www.w3af.com/index.aspx',
                         parsed[0].url_string)