Skip to content

Commit 8e284cc

Browse files
committed
chore: remove useless async method
Signed-off-by: copasseron <cpassero@cisco.com>
1 parent 9e00555 commit 8e284cc

4 files changed

Lines changed: 8 additions & 12 deletions

File tree

sdk/python/identityservice/badge/claims.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async def create_claims(url: str, service_name: str, service_type: AppType):
5656
)
5757

5858
# For OASF, we assume the URL is a path to the OASF JSON file
59-
schema = await oasf.discover(url)
59+
schema = oasf.discover(url)
6060

6161
claims["oasf"] = {
6262
"schema_base64": base64.b64encode(schema.encode("utf-8")),

sdk/python/identityservice/badge/oasf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from identityservice.exceptions import SdkError
88

99

10-
async def discover(url: str) -> str:
10+
def discover(url: str) -> str:
1111
"""Load an OASF schema from a local JSON file.
1212
1313
For OASF, we assume ``url`` is a path to the OASF JSON file that

sdk/python/tests/unit/badge/test_claims.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ async def test_create_claims_for_oasf_agent():
7272
# Act
7373
with patch(
7474
"identityservice.badge.oasf.discover",
75-
new_callable=AsyncMock,
7675
return_value=oasf_schema,
7776
) as mock_oasf_discover:
7877
claims = await create_claims(service_url, "", service_type)

sdk/python/tests/unit/badge/test_oasf.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,31 @@
1010
from identityservice.exceptions import SdkError
1111

1212

13-
@pytest.mark.asyncio
14-
async def test_discover_success(tmp_path: Path):
13+
def test_discover_success(tmp_path: Path):
1514
"""discover should return file contents when file exists and is non-empty."""
1615
schema_path = tmp_path / "oasf.json"
1716
content = '{"version": "1.0.0", "name": "Test OASF Agent"}'
1817
schema_path.write_text(content, encoding="utf-8")
1918

20-
result = await oasf.discover(str(schema_path))
19+
result = oasf.discover(str(schema_path))
2120

2221
assert result == content
2322

2423

25-
@pytest.mark.asyncio
26-
async def test_discover_raises_when_file_missing():
24+
def test_discover_raises_when_file_missing():
2725
"""discover should raise SdkError when file does not exist."""
2826
with pytest.raises(SdkError) as excinfo:
29-
await oasf.discover("/non/existent/oasf.json")
27+
oasf.discover("/non/existent/oasf.json")
3028

3129
assert "OASF schema file not found" in str(excinfo.value)
3230

3331

34-
@pytest.mark.asyncio
35-
async def test_discover_raises_when_file_empty(tmp_path: Path):
32+
def test_discover_raises_when_file_empty(tmp_path: Path):
3633
"""discover should raise SdkError when file is empty."""
3734
schema_path = tmp_path / "empty.json"
3835
schema_path.write_text("", encoding="utf-8")
3936

4037
with pytest.raises(SdkError) as excinfo:
41-
await oasf.discover(str(schema_path))
38+
oasf.discover(str(schema_path))
4239

4340
assert "OASF schema file is empty" in str(excinfo.value)

0 commit comments

Comments
 (0)