mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 08:00:54 +00:00
test added: clear protocol data
This commit is contained in:
@ -51,6 +51,16 @@ def test_remove_protocols():
|
|||||||
assert peer_data.get_protocols() == ["protocol2"]
|
assert peer_data.get_protocols() == ["protocol2"]
|
||||||
|
|
||||||
|
|
||||||
|
# Test case when clearing the protocol list:
|
||||||
|
def test_clear_protocol_data():
|
||||||
|
peer_data = PeerData()
|
||||||
|
protocols: Sequence[str] = ["protocol1", "protocol2"]
|
||||||
|
peer_data.set_protocols(protocols)
|
||||||
|
|
||||||
|
peer_data.clear_protocol_data()
|
||||||
|
assert peer_data.get_protocols() == []
|
||||||
|
|
||||||
|
|
||||||
# Test case when supports protocols:
|
# Test case when supports protocols:
|
||||||
def test_supports_protocols():
|
def test_supports_protocols():
|
||||||
peer_data = PeerData()
|
peer_data = PeerData()
|
||||||
@ -84,16 +94,6 @@ def test_first_supported_protocol_none():
|
|||||||
assert first == "None supported"
|
assert first == "None supported"
|
||||||
|
|
||||||
|
|
||||||
# Test case for clearing protocol data
|
|
||||||
def test_clear_protocol_data():
|
|
||||||
peer_data = PeerData()
|
|
||||||
peer_data.set_protocols(["proto1", "proto2"])
|
|
||||||
|
|
||||||
peer_data.clear_protocol_data()
|
|
||||||
|
|
||||||
assert peer_data.get_protocols() == []
|
|
||||||
|
|
||||||
|
|
||||||
# Test case when adding addresses
|
# Test case when adding addresses
|
||||||
def test_add_addrs():
|
def test_add_addrs():
|
||||||
peer_data = PeerData()
|
peer_data = PeerData()
|
||||||
|
|||||||
Reference in New Issue
Block a user