Skip to content

Commit 3c18274

Browse files
Copilot0xrinegade
andcommitted
Fix black formatting issues in test files
Co-authored-by: 0xrinegade <[email protected]>
1 parent 5e92d4d commit 3c18274

File tree

6 files changed

+154
-164
lines changed

6 files changed

+154
-164
lines changed

python/tests/unit/test_additional_coverage.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest
66
from solana_ai_registries.types import ServiceEndpoint
77
from solana_ai_registries.client import SolanaAIRegistriesClient
8-
from solana_ai_registries.idl import IDLLoader
8+
from solana_ai_registries.idl import IDLLoader
99
from solana_ai_registries.exceptions import IDLError
1010

1111

@@ -14,25 +14,19 @@ class TestServiceEndpointProtocolDetection:
1414

1515
def test_http_protocol_detection(self):
1616
"""Test HTTP protocol auto-detection from URL."""
17-
endpoint = ServiceEndpoint(
18-
url="http://example.com",
19-
auth_type="none"
20-
)
17+
endpoint = ServiceEndpoint(url="http://example.com", auth_type="none")
2118
assert endpoint.protocol == "http"
2219

2320
def test_https_protocol_detection(self):
24-
"""Test HTTPS protocol auto-detection from URL."""
25-
endpoint = ServiceEndpoint(
26-
url="https://example.com",
27-
auth_type="none"
28-
)
21+
"""Test HTTPS protocol auto-detection from URL."""
22+
endpoint = ServiceEndpoint(url="https://example.com", auth_type="none")
2923
assert endpoint.protocol == "https"
3024

3125
def test_unknown_protocol_detection(self):
3226
"""Test unknown protocol detection for non-HTTP URLs."""
3327
endpoint = ServiceEndpoint(
3428
url="https://example.com", # Use valid URL
35-
protocol="ftp" # Explicitly set unknown protocol
29+
protocol="ftp", # Explicitly set unknown protocol
3630
)
3731
assert endpoint.protocol == "ftp"
3832

@@ -75,4 +69,4 @@ def test_load_nonexistent_idl(self):
7569
"""Test loading non-existent IDL raises error."""
7670
loader = IDLLoader()
7771
with pytest.raises(IDLError):
78-
loader.load_idl("nonexistent_program")
72+
loader.load_idl("nonexistent_program")

python/tests/unit/test_coverage_boost.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
Additional coverage tests for payments and MCP modules.
33
"""
44

5-
import pytest
6-
from decimal import Decimal
75
from solana_ai_registries.payments import PaymentManager
86
from solana_ai_registries.mcp import McpServerRegistry
97
from solana_ai_registries.agent import AgentRegistry
@@ -15,33 +13,37 @@ class TestPaymentManagerBasics:
1513
def test_payment_manager_init_devnet(self):
1614
"""Test PaymentManager initialization for devnet."""
1715
from solana_ai_registries.client import SolanaAIRegistriesClient
16+
1817
client = SolanaAIRegistriesClient()
1918
manager = PaymentManager(client, use_mainnet=False)
20-
19+
2120
assert manager.client == client
2221

2322
def test_payment_manager_init_mainnet(self):
2423
"""Test PaymentManager initialization for mainnet."""
2524
from solana_ai_registries.client import SolanaAIRegistriesClient
25+
2626
client = SolanaAIRegistriesClient()
2727
manager = PaymentManager(client, use_mainnet=True)
28-
28+
2929
assert manager.client == client
3030

3131
def test_get_token_mint_devnet(self):
3232
"""Test getting token mint for devnet."""
3333
from solana_ai_registries.client import SolanaAIRegistriesClient
34+
3435
client = SolanaAIRegistriesClient()
3536
manager = PaymentManager(client, use_mainnet=False)
36-
37+
3738
assert manager.token_mint is not None
3839

3940
def test_get_token_mint_mainnet(self):
4041
"""Test getting token mint for mainnet."""
4142
from solana_ai_registries.client import SolanaAIRegistriesClient
43+
4244
client = SolanaAIRegistriesClient()
4345
manager = PaymentManager(client, use_mainnet=True)
44-
46+
4547
assert manager.token_mint is not None
4648

4749

@@ -51,9 +53,10 @@ class TestMcpServerRegistryBasics:
5153
def test_mcp_registry_init(self):
5254
"""Test McpServerRegistry initialization."""
5355
from solana_ai_registries.client import SolanaAIRegistriesClient
56+
5457
client = SolanaAIRegistriesClient()
5558
registry = McpServerRegistry(client)
56-
59+
5760
assert registry.client == client
5861

5962

@@ -63,9 +66,10 @@ class TestAgentRegistryBasics:
6366
def test_agent_registry_init(self):
6467
"""Test AgentRegistry initialization."""
6568
from solana_ai_registries.client import SolanaAIRegistriesClient
69+
6670
client = SolanaAIRegistriesClient()
6771
registry = AgentRegistry(client)
68-
72+
6973
assert registry.client == client
7074

7175

@@ -77,17 +81,17 @@ def test_import_constants(self):
7781
from solana_ai_registries.constants import (
7882
MAX_AGENT_ID_LEN,
7983
MAX_AGENT_NAME_LEN,
80-
A2AMPL_BASE_UNIT
84+
A2AMPL_BASE_UNIT,
8185
)
82-
86+
8387
assert MAX_AGENT_ID_LEN > 0
84-
assert MAX_AGENT_NAME_LEN > 0
88+
assert MAX_AGENT_NAME_LEN > 0
8589
assert A2AMPL_BASE_UNIT > 0
8690

8791
def test_validation_functions(self):
8892
"""Test validation functions."""
8993
from solana_ai_registries.constants import validate_string_length, validate_url
90-
94+
9195
# These should not raise
9296
validate_string_length("test", 10, "test field")
9397
validate_url("https://example.com", "test url")
@@ -101,14 +105,14 @@ def test_exception_creation(self):
101105
from solana_ai_registries.exceptions import (
102106
SolanaAIRegistriesError,
103107
AgentNotFoundError,
104-
McpServerNotFoundError
108+
McpServerNotFoundError,
105109
)
106-
110+
107111
base_error = SolanaAIRegistriesError("Base error")
108112
assert str(base_error) == "Base error"
109-
113+
110114
agent_error = AgentNotFoundError("test_agent", "test_owner")
111115
assert "test_agent" in str(agent_error)
112-
116+
113117
mcp_error = McpServerNotFoundError("test_server", "test_owner")
114-
assert "test_server" in str(mcp_error)
118+
assert "test_server" in str(mcp_error)

0 commit comments

Comments
 (0)