Skip to content

Commit f130b94

Browse files
authored
change: Remove api tests moved to upstream (#402)
1 parent 0856638 commit f130b94

File tree

6 files changed

+0
-517
lines changed

6 files changed

+0
-517
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ dependencies = [
5050
"pyyaml",
5151
"tenacity",
5252
"types-requests>=2.32.0.20241016",
53-
"schemathesis>=4.0.0a8",
5453
"requests",
5554
"pytest-asyncio",
5655
"syrupy",

schemathesis.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/model_registry/conftest.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import os
21
import pytest
32
from pytest import Config
4-
import schemathesis
53
from typing import Generator, Any
64

75
from ocp_resources.infrastructure import Infrastructure
@@ -14,10 +12,6 @@
1412
from ocp_resources.deployment import Deployment
1513

1614
from ocp_resources.model_registry_modelregistry_opendatahub_io import ModelRegistry
17-
from schemathesis.specs.openapi.schemas import BaseOpenAPISchema
18-
from schemathesis.generation.stateful.state_machine import APIStateMachine
19-
from schemathesis.core.transport import Response
20-
from schemathesis.generation.case import Case
2115
from ocp_resources.resource import ResourceEditor
2216

2317
from pytest import FixtureRequest
@@ -299,43 +293,6 @@ def model_registry_instance_rest_endpoint(
299293
return get_endpoint_from_mr_service(svc=model_registry_instance_service, protocol=Protocols.REST)
300294

301295

302-
@pytest.fixture(scope="class")
303-
def generated_schema(pytestconfig: Config, model_registry_instance_rest_endpoint: str) -> BaseOpenAPISchema:
304-
os.environ["API_HOST"] = model_registry_instance_rest_endpoint
305-
config = schemathesis.config.SchemathesisConfig.from_path(f"{pytestconfig.rootpath}/schemathesis.toml")
306-
schema = schemathesis.openapi.from_url(
307-
url="https://raw.githubusercontent.com/kubeflow/model-registry/main/api/openapi/model-registry.yaml",
308-
config=config,
309-
)
310-
return schema
311-
312-
313-
@pytest.fixture()
314-
def state_machine(generated_schema: BaseOpenAPISchema, current_client_token: str) -> APIStateMachine:
315-
BaseAPIWorkflow = generated_schema.as_state_machine()
316-
317-
class APIWorkflow(BaseAPIWorkflow): # type: ignore
318-
headers: dict[str, str]
319-
320-
def setup(self) -> None:
321-
self.headers = {"Authorization": f"Bearer {current_client_token}", "Content-Type": "application/json"}
322-
323-
def before_call(self, case: Case) -> None:
324-
LOGGER.info(f"Checking: {case.method} {case.path}")
325-
326-
# these kwargs are passed to requests.request()
327-
def get_call_kwargs(self, case: Case) -> dict[str, Any]:
328-
return {"verify": False, "headers": self.headers}
329-
330-
def after_call(self, response: Response, case: Case) -> None:
331-
LOGGER.info(
332-
f"Method tested: {case.method}, API: {case.path}, response code:{response.status_code},"
333-
f" Full Response:{response.text}"
334-
)
335-
336-
return APIWorkflow
337-
338-
339296
@pytest.fixture(scope="class")
340297
def updated_dsc_component_state_scope_class(
341298
pytestconfig: Config,

tests/model_registry/test_rest_api.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/model_registry/test_rest_api_stateful.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)