def test_default_proto(self): """ http is the default protocol, we can provide URLs with no proto """ u = URL("w3af.com") self.assertEqual(u.get_domain(), "w3af.com") self.assertEqual(u.get_protocol(), "http")
def test_default_proto(self): """ http is the default protocol, we can provide URLs with no proto """ u = URL('w3af.com') self.assertEqual(u.get_domain(), 'w3af.com') self.assertEqual(u.get_protocol(), 'http')
def setUp(self): self.kb.cleanup() self.w3afcore = w3afCore() if self.MOCK_RESPONSES: httpretty.enable() url = URL(self.target_url) domain = url.get_domain() proto = url.get_protocol() port = url.get_port() self._register_httpretty_uri(proto, domain, port)
def setUp(self): self.kb.cleanup() self.w3afcore = w3afCore() if self.MOCK_RESPONSES: httpretty.enable() try: url = URL(self.target_url) except ValueError, ve: msg = 'When using MOCK_RESPONSES you need to set the'\ ' target_url attribute to a valid URL, exception was:'\ ' "%s".' raise Exception(msg % ve) domain = url.get_domain() proto = url.get_protocol() port = url.get_port() self._register_httpretty_uri(proto, domain, port)
def test_set_protocol(self): u = URL("http://1.2.3.4") self.assertEqual(u.get_protocol(), "http") u.set_protocol("https") self.assertEqual(u.get_protocol(), "https")
def test_set_protocol(self): u = URL("http://1.2.3.4") self.assertEqual(u.get_protocol(), 'http') u.set_protocol('https') self.assertEqual(u.get_protocol(), 'https')