本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)