Exemple #1
0
    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'), ['*****@*****.**'])
Exemple #2
0
    def test_parse_blank(self):
        response = HTTPResponse(200, '', Headers(), self.url, self.url)
        bp_inst = BaseParser(response)

        self.assertEqual(bp_inst.get_emails(), set())

        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)
        self.assertRaises(NotImplementedError, bp_inst.get_scripts)