File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
tests/discovery/bootstrap Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 3
3
Test bootstrap address validation
4
4
"""
5
5
6
- import pytest
7
6
from libp2p .discovery .bootstrap .utils import (
8
7
parse_bootstrap_peer_info ,
9
8
validate_bootstrap_addresses ,
10
9
)
11
10
11
+
12
12
def test_validate_addresses ():
13
13
"""Test validation with a mix of valid and invalid addresses in one list."""
14
14
addresses = [
@@ -26,10 +26,14 @@ def test_validate_addresses():
26
26
"/ip4/104.236.179.241/tcp/4001/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM" ,
27
27
]
28
28
validated = validate_bootstrap_addresses (addresses )
29
- assert validated == valid_expected , f"Expected only valid addresses, got: { validated } "
29
+ assert validated == valid_expected , (
30
+ f"Expected only valid addresses, got: { validated } "
31
+ )
30
32
for addr in addresses :
31
33
peer_info = parse_bootstrap_peer_info (addr )
32
34
if addr in valid_expected :
33
- assert peer_info is not None and peer_info .peer_id is not None , f"Should parse valid address: { addr } "
35
+ assert peer_info is not None and peer_info .peer_id is not None , (
36
+ f"Should parse valid address: { addr } "
37
+ )
34
38
else :
35
39
assert peer_info is None , f"Should not parse invalid address: { addr } "
You can’t perform that action at this time.
0 commit comments