def test_get_path_qs(self): u = URL(u"https://w3af.com:443/xyz/123/456/789/") self.assertEqual(u.get_path(), u"/xyz/123/456/789/") u = URL(u"https://w3af.com:443/xyz/123/456/789/") self.assertEqual(u.get_path_qs(), u"/xyz/123/456/789/") u = URL(u"https://w3af.com:443/xyz/file.asp") self.assertEqual(u.get_path_qs(), u"/xyz/file.asp") u = URL(u"https://w3af.com:443/xyz/file.asp?id=1") self.assertEqual(u.get_path_qs(), u"/xyz/file.asp?id=1")
def test_get_path_qs(self): u = URL(u'https://w3af.com:443/xyz/123/456/789/') self.assertEqual(u.get_path(), u'/xyz/123/456/789/') u = URL(u'https://w3af.com:443/xyz/123/456/789/') self.assertEqual(u.get_path_qs(), u'/xyz/123/456/789/') u = URL(u'https://w3af.com:443/xyz/file.asp') self.assertEqual(u.get_path_qs(), u'/xyz/file.asp') u = URL(u'https://w3af.com:443/xyz/file.asp?id=1') self.assertEqual(u.get_path_qs(), u'/xyz/file.asp?id=1')
def test_set_params(self): u = URL("http://w3af.com/;id=1") u.set_param("file=2") self.assertEqual(u.get_params_string(), "file=2") u = URL("http://w3af.com/xyz.txt;id=1?file=2") u.set_param("file=3") self.assertEqual(u.get_params_string(), "file=3") self.assertEqual(u.get_path_qs(), "/xyz.txt;file=3?file=2")
def test_set_params(self): u = URL('http://w3af.com/;id=1') u.set_param('file=2') self.assertEqual(u.get_params_string(), 'file=2') u = URL('http://w3af.com/xyz.txt;id=1?file=2') u.set_param('file=3') self.assertEqual(u.get_params_string(), 'file=3') self.assertEqual(u.get_path_qs(), '/xyz.txt;file=3?file=2')