当前位置: 首页>>代码示例>>Python>>正文


Python URL.get_net_location方法代码示例

本文整理汇总了Python中w3af.core.data.parsers.doc.url.URL.get_net_location方法的典型用法代码示例。如果您正苦于以下问题:Python URL.get_net_location方法的具体用法?Python URL.get_net_location怎么用?Python URL.get_net_location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在w3af.core.data.parsers.doc.url.URL的用法示例。


在下文中一共展示了URL.get_net_location方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_ssl_fail_when_requesting_moth_http

# 需要导入模块: from w3af.core.data.parsers.doc.url import URL [as 别名]
# 或者: from w3af.core.data.parsers.doc.url.URL import get_net_location [as 别名]
    def test_ssl_fail_when_requesting_moth_http(self):
        """
        https://github.com/andresriancho/w3af/issues/7989

        This test takes considerable time to run since it needs to timeout the
        SSL connection for each SSL protocol
        """
        # Note that here I'm using httpS <<---- "S" and that I'm connecting to
        # the net location (host:port) of an HTTP server.
        http_url = URL(get_moth_http())
        test_url = URL('https://%s' % http_url.get_net_location())

        self.uri_opener.settings.set_max_http_retries(0)

        self.assertRaises(HTTPRequestException,
                          self.uri_opener.GET,
                          test_url,
                          timeout=1)
开发者ID:0x554simon,项目名称:w3af,代码行数:20,代码来源:test_xurllib.py

示例2: test_set_domain_with_port

# 需要导入模块: from w3af.core.data.parsers.doc.url import URL [as 别名]
# 或者: from w3af.core.data.parsers.doc.url.URL import get_net_location [as 别名]
 def test_set_domain_with_port(self):
     u = URL('http://w3af.com:443/def/jkl/')
     self.assertEqual(u.get_domain(), 'w3af.com')
     
     u.set_domain('host.tld')
     self.assertEqual(u.get_net_location(), 'host.tld:443')
开发者ID:batmanWjw,项目名称:w3af,代码行数:8,代码来源:test_url.py


注:本文中的w3af.core.data.parsers.doc.url.URL.get_net_location方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。