Skip to content

Commit 51c08de

Browse files
committed
test added: clear protocol data
1 parent faeacf6 commit 51c08de

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/core/peer/test_peerdata.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ def test_remove_protocols():
5151
assert peer_data.get_protocols() == ["protocol2"]
5252

5353

54+
# Test case when clearing the protocol list:
55+
def test_clear_protocol_data():
56+
peer_data = PeerData()
57+
protocols: Sequence[str] = ["protocol1", "protocol2"]
58+
peer_data.set_protocols(protocols)
59+
60+
peer_data.clear_protocol_data()
61+
assert peer_data.get_protocols() == []
62+
63+
5464
# Test case when supports protocols:
5565
def test_supports_protocols():
5666
peer_data = PeerData()
@@ -84,16 +94,6 @@ def test_first_supported_protocol_none():
8494
assert first == "None supported"
8595

8696

87-
# Test case for clearing protocol data
88-
def test_clear_protocol_data():
89-
peer_data = PeerData()
90-
peer_data.set_protocols(["proto1", "proto2"])
91-
92-
peer_data.clear_protocol_data()
93-
94-
assert peer_data.get_protocols() == []
95-
96-
9797
# Test case when adding addresses
9898
def test_add_addrs():
9999
peer_data = PeerData()

0 commit comments

Comments
 (0)