Esempio n. 1
0
 def test_starts_without_slash(self):
     #
     # TODO: This is a bug!
     #
     #       Removing the SkipTest will show that the test is matching
     #       /def/123.html instead of the expected abd/def/123.html
     #
     #       The regular expression matches start with /
     #
     matches = RELATIVE_URL_RE.findall('abc/def/123.html')
     self.assertEqual(matches[0][0], 'abc/def/123.html')
Esempio n. 2
0
 def test_relative(self):
     matches = RELATIVE_URL_RE.findall('../../foobar/uploads/bar.html')
     self.assertEqual(matches[0][0], '/../foobar/uploads/bar.html')
Esempio n. 3
0
 def test_two_slashes(self):
     # This is filtered by ReExtract._filter_false_urls
     matches = RELATIVE_URL_RE.findall('//foo.123.html')
     self.assertEqual(matches[0][0], '//foo.123.html')
Esempio n. 4
0
 def test_with_padding(self):
     matches = RELATIVE_URL_RE.findall('123 /abc/def/123.html 456')
     self.assertEqual(matches[0][0], '/abc/def/123.html')
Esempio n. 5
0
 def test_no_match_2(self):
     matches = RELATIVE_URL_RE.findall('abc.html')
     self.assertEqual(matches, [])
Esempio n. 6
0
 def test_simple_filename(self):
     matches = RELATIVE_URL_RE.findall('/abc.html')
     self.assertEqual(matches[0][0], '/abc.html')
Esempio n. 7
0
 def test_no_match_1(self):
     matches = RELATIVE_URL_RE.findall('/abc')
     self.assertEqual(matches, [])
Esempio n. 8
0
 def test_with_fake_start(self):
     matches = RELATIVE_URL_RE.findall('</abc> /def.html')
     self.assertEqual(matches[0][0], '/def.html')
Esempio n. 9
0
 def test_full_url(self):
     # This is filtered by ReExtract._filter_false_urls
     matches = RELATIVE_URL_RE.findall('http://w3af.org/foo.html')
     self.assertEqual(matches[0][0], '://w3af.org/foo.html')
Esempio n. 10
0
 def test_path_query_string_multi(self):
     matches = RELATIVE_URL_RE.findall('/abc/foo.html?id=1&foo=1')
     self.assertEqual(matches[0][0], '/abc/foo.html?id=1&foo=1')
Esempio n. 11
0
 def test_query_string(self):
     matches = RELATIVE_URL_RE.findall('/foo.html?id=1')
     self.assertEqual(matches[0][0], '/foo.html?id=1')