Skip to content

Commit bb25494

Browse files
committed
fix: we cannot import from rasenmaeher_api inside the test container
1 parent adb7571 commit bb25494

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/ptfpapi/fprun.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,28 @@
1818
UserInstructionFragment,
1919
UserCRUDRequest,
2020
)
21+
from pydantic import BaseModel, Field, Extra
2122

2223

23-
from rasenmaeher_api.web.api.product.schema import ProductAddRequest
24+
# FIXME: Move to libpvarki
25+
class ProductAddRequest(BaseModel): # pylint: disable=too-few-public-methods
26+
"""Request to add product interoperability."""
27+
28+
certcn: str = Field(description="CN of the certificate")
29+
x509cert: str = Field(description="Certificate encoded with CFSSL conventions (newlines escaped)")
30+
31+
class Config: # pylint: disable=too-few-public-methods
32+
"""Example values for schema"""
33+
34+
extra = Extra.forbid
35+
schema_extra = {
36+
"examples": [
37+
{
38+
"certcn": "product.deployment.tld",
39+
"x509cert": "-----BEGIN CERTIFICATE-----\\nMIIEwjCC...\\n-----END CERTIFICATE-----\\n",
40+
},
41+
],
42+
}
2443

2544

2645
LOGGER = logging.getLogger(__name__)

0 commit comments

Comments
 (0)