def test_basics(self): divided_path = DataContainer() divided_path["start"] = "/" divided_path["modified_part"] = "ping!" divided_path["end"] = "/bar" freq = HTTPQSRequest(URL("http://www.w3af.com/foo/bar")) m = URLPartsMutant(freq) m.set_mutant_dc(divided_path) m.set_var("modified_part") self.assertEqual(m.get_url().url_string, u"http://www.w3af.com/ping%21/bar") expected_mod_value = 'The sent urlparts is: "/ping!/bar".' generated_mod_value = m.print_mod_value() self.assertEqual(generated_mod_value, expected_mod_value) expected_found_at = ( '"http://www.w3af.com/ping%21/bar", using HTTP method' " GET. The modified parameter was the URL path, with" ' value: "ping!".' ) generated_found_at = m.found_at() self.assertEqual(generated_found_at, expected_found_at)
def test_basics(self): divided_path = URLPartsContainer('/', 'ping!', '/bar') freq = FuzzableRequest(URL('http://www.w3af.com/foo/bar')) m = URLPartsMutant(freq) m.set_dc(divided_path) self.assertEqual(m.get_url().url_string, u'http://www.w3af.com/ping%21/bar') expected_found_at = '"http://www.w3af.com/ping%21/bar", using HTTP method'\ ' GET. The modified parameter was the URL path, with'\ ' value: "ping!".' generated_found_at = m.found_at() self.assertEqual(generated_found_at, expected_found_at)
def test_basics(self): divided_path = URLPartsContainer('/', 'ping!', '/bar') freq = FuzzableRequest(URL('http://www.w3af.com/foo/bar')) m = URLPartsMutant(freq) m.set_dc(divided_path) self.assertEqual(m.get_url().url_string, u'http://www.w3af.com/ping%21/bar') expected_found_at = '"http://www.w3af.com/ping%21/bar", using HTTP method'\ ' GET. The modified parameter was the URL path, with'\ ' value: "ping!".' generated_found_at = m.found_at() self.assertEqual(generated_found_at, expected_found_at)
def test_basics(self): divided_path = DataContainer() divided_path['start'] = '/' divided_path['modified_part'] = 'ping!' divided_path['end'] = '/bar' freq = HTTPQSRequest(URL('http://www.w3af.com/foo/bar')) m = URLPartsMutant(freq) m.set_mutant_dc(divided_path) m.set_var('modified_part') self.assertEqual(m.get_url().url_string, u'http://www.w3af.com/ping%21/bar') expected_mod_value = 'The sent urlparts is: "/ping!/bar".' generated_mod_value = m.print_mod_value() self.assertEqual(generated_mod_value, expected_mod_value) expected_found_at = '"http://www.w3af.com/ping%21/bar", using HTTP method'\ ' GET. The modified parameter was the URL path, with'\ ' value: "ping!".' generated_found_at = m.found_at() self.assertEqual(generated_found_at, expected_found_at)