コード例 #1
0
ファイル: test_baseparser.py プロジェクト: z0r1nga/w3af
    def test_decode_url_url_encoded(self):
        u = URL('http://www.w3af.com/')
        response = HTTPResponse(200, u'', Headers(), u, u, charset='latin1')
        bp_inst = BaseParser(response)
        bp_inst._encoding = 'latin1'

        decoded_url = bp_inst._decode_url(u'http://www.w3af.com/ind%E9x.html')
        self.assertEqual(decoded_url, u'http://www.w3af.com/ind\xe9x.html')
コード例 #2
0
    def test_parse_blank(self):
        response = HTTPResponse(200, '', Headers(), self.url, self.url)
        bp_inst = BaseParser(response)

        self.assertRaises(NotImplementedError, bp_inst.get_comments)
        self.assertRaises(NotImplementedError, bp_inst.get_forms)
        self.assertRaises(NotImplementedError, bp_inst.get_meta_redir)
        self.assertRaises(NotImplementedError, bp_inst.get_meta_tags)
        self.assertRaises(NotImplementedError, bp_inst.get_references)
コード例 #3
0
ファイル: test_baseparser.py プロジェクト: intfrr/Tortazo
    def test_decode_url_ignore_errors(self):
        u = URL('http://www.w3af.com/')
        response = HTTPResponse(200, u'', Headers(), u, u, charset='latin1')
        bp_inst = BaseParser(response)
        bp_inst._encoding = 'utf-8'

        decoded_url = bp_inst._decode_url(
            u'http://w3af.com/blah.jsp?p=SQU-300&bgc=%FFAAAA')
        self.assertEqual(decoded_url,
                         u'http://w3af.com/blah.jsp?p=SQU-300&bgc=AAAA')
コード例 #4
0
ファイル: test_baseparser.py プロジェクト: intfrr/Tortazo
    def test_decode_url_skip_safe_chars(self):
        u = URL('http://www.w3af.com/')
        response = HTTPResponse(200, u'', Headers(), u, u, charset='latin1')
        bp_inst = BaseParser(response)
        bp_inst._encoding = 'latin1'

        decoded_url = bp_inst._decode_url(
            u'http://w3af.com/search.php?a=%00x&b=2%20c=3%D1')
        self.assertEqual(decoded_url,
                         u'http://w3af.com/search.php?a=%00x&b=2 c=3\xd1')
コード例 #5
0
ファイル: test_baseparser.py プロジェクト: intfrr/Tortazo
    def test_get_emails_filter(self):
        response = HTTPResponse(200, '', Headers(), self.url, self.url)
        bp_inst = BaseParser(response)
        bp_inst._emails = ['*****@*****.**', '*****@*****.**']

        self.assertEqual(bp_inst.get_emails(),
                         ['*****@*****.**', '*****@*****.**'])

        self.assertEqual(bp_inst.get_emails(domain='w3af.com'), ['*****@*****.**'])
        self.assertEqual(bp_inst.get_emails(domain='not-w3af.com'),
                         ['*****@*****.**'])
コード例 #6
0
ファイル: test_baseparser.py プロジェクト: z0r1nga/w3af
 def setUp(self):
     self.url = URL('http://www.w3af.com/')
     response = HTTPResponse(200, '', Headers(), self.url, self.url)
     self.bp_inst = BaseParser(response)