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


Python Client.disconnect_local方法代码示例

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


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

示例1: test_connection_already_exist

# 需要导入模块: from zeroless import Client [as 别名]
# 或者: from zeroless.Client import disconnect_local [as 别名]
    def test_connection_already_exist(self):
        client = Client()
        client.connect_local(port=1024)

        with pytest.raises(ValueError):
            client.connect_local(port=1024)

        client.disconnect_local(port=1024)
        client.connect_local(port=1024)
开发者ID:davinirjr,项目名称:zeroless,代码行数:11,代码来源:test_exceptions.py

示例2: test_port_under_range

# 需要导入模块: from zeroless import Client [as 别名]
# 或者: from zeroless.Client import disconnect_local [as 别名]
    def test_port_under_range(self):
        client = Client()
        with pytest.raises(ValueError):
           client.connect_local(port=1023)

        with pytest.raises(ValueError):
           client.disconnect_local(port=1023)

        with pytest.raises(ValueError):
            Server(port=1023)
开发者ID:davinirjr,项目名称:zeroless,代码行数:12,代码来源:test_exceptions.py

示例3: test_connection_after_pattern_was_established

# 需要导入模块: from zeroless import Client [as 别名]
# 或者: from zeroless.Client import disconnect_local [as 别名]
    def test_connection_after_pattern_was_established(self):
        client = Client()
        listen_for_push = client.pull()

        client.connect_local(port=1024)

        with pytest.raises(ValueError):
            client.connect_local(port=1024)

        client.disconnect_local(port=1024)

        with pytest.raises(ValueError):
            client.disconnect_local(port=1024)
开发者ID:davinirjr,项目名称:zeroless,代码行数:15,代码来源:test_exceptions.py

示例4: test_port_on_range

# 需要导入模块: from zeroless import Client [as 别名]
# 或者: from zeroless.Client import disconnect_local [as 别名]
 def test_port_on_range(self):
     client = Client()
     client.connect_local(port=1024)
     client.disconnect_local(port=1024)
     client.connect_local(port=7000)
     client.disconnect_local(port=7000)
     client.connect_local(port=65535)
     client.disconnect_local(port=65535)
开发者ID:davinirjr,项目名称:zeroless,代码行数:10,代码来源:test_exceptions.py

示例5: test_there_was_no_connection_to_disconnect

# 需要导入模块: from zeroless import Client [as 别名]
# 或者: from zeroless.Client import disconnect_local [as 别名]
    def test_there_was_no_connection_to_disconnect(self):
        client = Client()
        client.connect_local(port=1024)

        with pytest.raises(ValueError):
            client.disconnect_local(port=1025)

        client.disconnect_local(port=1024)

        with pytest.raises(ValueError):
            client.disconnect_local(port=1024)
开发者ID:davinirjr,项目名称:zeroless,代码行数:13,代码来源:test_exceptions.py


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