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")
示例#2
0
 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')
示例#3
0
文件: helper.py 项目: cathartic/w3af
    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)
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
    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")
示例#8
0
    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')
示例#9
0
 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')