Skip to content

Commit 29e9435

Browse files
committed
fix: add test for interop request
1 parent 696acef commit 29e9435

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ def session_env_config( # pylint: disable=R0915,R0914
110110
"uri": "https://nonexistent.localmaeher.dev.pvarki.fi:844/", # Not actually there
111111
"certcn": "nonexistent.localmaeher.dev.pvarki.fi",
112112
},
113+
"interoptest": {
114+
"api": "https://localhost:4657/",
115+
"uri": "https://interoptest.localmaeher.dev.pvarki.fi:844/", # Not actually there
116+
"certcn": "interoptest.localmaeher.dev.pvarki.fi",
117+
},
113118
},
114119
}
115120
)

tests/test_interop.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""Test the interop route"""
2+
3+
import logging
4+
5+
import pytest
6+
from async_asgi_testclient import TestClient
7+
8+
from rasenmaeher_api.web.api.product.schema import ProductAddRequest
9+
10+
LOGGER = logging.getLogger(__name__)
11+
12+
13+
@pytest.mark.asyncio
14+
async def test_fake_fake(ginosession: None, unauth_client: TestClient) -> None:
15+
"""Test requesting interop with product 'fake'"""
16+
_ = ginosession
17+
client = unauth_client
18+
client.headers.update({"X-ClientCert-DN": "CN=interoptest.localmaeher.dev.pvarki.fi,O=N/A"})
19+
req = ProductAddRequest(
20+
certcn="interoptest.localmaeher.dev.pvarki.fi",
21+
x509cert="-----BEGIN CERTIFICATE-----\\nMIIEwjCC...\\n-----END CERTIFICATE-----\\n",
22+
)
23+
payload = req.dict()
24+
resp = await client.post("/api/v1/product/interop/fake", json=payload)
25+
assert resp.status_code == 200

0 commit comments

Comments
 (0)