forked from opendatahub-io/opendatahub-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_model_registry_creation.py
More file actions
46 lines (39 loc) · 1.44 KB
/
test_model_registry_creation.py
File metadata and controls
46 lines (39 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import pytest
from typing import Self
from model_registry import ModelRegistry as ModelRegistryClient
from simple_logger.logger import get_logger
from tests.model_registry.constants import MODEL_NAME, MR_NAMESPACE
from tests.model_registry.utils import register_model, get_and_validate_registered_model
from utilities.constants import DscComponents
LOGGER = get_logger(name=__name__)
@pytest.mark.parametrize(
"updated_dsc_component_state_scope_class",
[
pytest.param(
{
"component_patch": {
DscComponents.MODELREGISTRY: {
"managementState": DscComponents.ManagementState.MANAGED,
"registriesNamespace": MR_NAMESPACE,
},
}
},
)
],
indirect=True,
)
@pytest.mark.usefixtures("updated_dsc_component_state_scope_class")
class TestModelRegistryCreation:
"""
Tests the creation of a model registry. If the component is set to 'Removed' it will be switched to 'Managed'
for the duration of this test module.
"""
@pytest.mark.smoke
def test_registering_model(
self: Self,
model_registry_client: ModelRegistryClient,
):
model = register_model(model_registry_client=model_registry_client)
get_and_validate_registered_model(
model_registry_client=model_registry_client, model_name=MODEL_NAME, registered_model=model
)