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


Python TCPHiddenServiceEndpoint.private_tor方法代码示例

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


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

示例1: test_endpoint_properties

# 需要导入模块: from txtorcon import TCPHiddenServiceEndpoint [as 别名]
# 或者: from txtorcon.TCPHiddenServiceEndpoint import private_tor [as 别名]
 def test_endpoint_properties(self):
     ep = yield TCPHiddenServiceEndpoint.private_tor(Mock(), 80)
     self.assertEqual(None, ep.onion_private_key)
     self.assertEqual(None, ep.onion_uri)
     ep.hiddenservice = Mock()
     ep.hiddenservice.private_key = 'mumble'
     self.assertEqual('mumble', ep.onion_private_key)
开发者ID:coffeemakr,项目名称:txtorcon,代码行数:9,代码来源:test_endpoints.py

示例2: test_private_tor

# 需要导入模块: from txtorcon import TCPHiddenServiceEndpoint [as 别名]
# 或者: from txtorcon.TCPHiddenServiceEndpoint import private_tor [as 别名]
 def test_private_tor(self):
     m = Mock()
     from txtorcon import endpoints
     endpoints.launch_tor = m
     ep = yield TCPHiddenServiceEndpoint.private_tor(Mock(), 80,
                                                     control_port=1234)
     self.assertTrue(m.called)
开发者ID:coffeemakr,项目名称:txtorcon,代码行数:9,代码来源:test_endpoints.py

示例3: test_private_tor_no_control_port

# 需要导入模块: from txtorcon import TCPHiddenServiceEndpoint [as 别名]
# 或者: from txtorcon.TCPHiddenServiceEndpoint import private_tor [as 别名]
    def test_private_tor_no_control_port(self):
        m = Mock()
        from txtorcon import endpoints

        endpoints.launch_tor = m
        ep = yield TCPHiddenServiceEndpoint.private_tor(Mock(), 80)
        m.assert_called()
开发者ID:isislovecruft,项目名称:txtorcon,代码行数:9,代码来源:test_endpoints.py

示例4: test_hiddenservice_key_unfound

# 需要导入模块: from txtorcon import TCPHiddenServiceEndpoint [as 别名]
# 或者: from txtorcon.TCPHiddenServiceEndpoint import private_tor [as 别名]
    def test_hiddenservice_key_unfound(self):
        ep = TCPHiddenServiceEndpoint.private_tor(self.reactor, 1234, hidden_service_dir="/dev/null")

        # FIXME Mock() should work somehow for this, but I couldn't
        # make it "go"
        class Blam(object):
            @property
            def private_key(self):
                raise IOError("blam")

        ep.hiddenservice = Blam()
        self.assertEqual(ep.onion_private_key, None)
        return ep
开发者ID:isislovecruft,项目名称:txtorcon,代码行数:15,代码来源:test_endpoints.py

示例5: test_progress_updates_private_tor

# 需要导入模块: from txtorcon import TCPHiddenServiceEndpoint [as 别名]
# 或者: from txtorcon.TCPHiddenServiceEndpoint import private_tor [as 别名]
 def test_progress_updates_private_tor(self, tor):
     ep = TCPHiddenServiceEndpoint.private_tor(self.reactor, 1234)
     tor.call_args[1]['progress_updates'](40, 'FOO', 'foo to the bar')
     return ep
开发者ID:coffeemakr,项目名称:txtorcon,代码行数:6,代码来源:test_endpoints.py

示例6: test_progress_updates_private_tor

# 需要导入模块: from txtorcon import TCPHiddenServiceEndpoint [as 别名]
# 或者: from txtorcon.TCPHiddenServiceEndpoint import private_tor [as 别名]
 def test_progress_updates_private_tor(self, ftb):
     with patch('txtorcon.endpoints.launch_tor') as tor:
         ep = TCPHiddenServiceEndpoint.private_tor(self.reactor, 1234)
         self.assertEqual(len(tor.mock_calls), 1)
         tor.call_args[1]['progress_updates'](40, 'FOO', 'foo to the bar')
         return ep
开发者ID:felipedau,项目名称:txtorcon,代码行数:8,代码来源:test_endpoints.py

示例7: test_private_tor_no_control_port

# 需要导入模块: from txtorcon import TCPHiddenServiceEndpoint [as 别名]
# 或者: from txtorcon.TCPHiddenServiceEndpoint import private_tor [as 别名]
 def test_private_tor_no_control_port(self, ftb):
     m = Mock()
     from txtorcon import endpoints
     endpoints.launch_tor = m
     yield TCPHiddenServiceEndpoint.private_tor(Mock(), 80)
     self.assertTrue(m.called)
开发者ID:felipedau,项目名称:txtorcon,代码行数:8,代码来源:test_endpoints.py


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