Exemplo n.º 1
0
def _check_basic_actions_are_available(client: ADCMClient):
    """Check if basic actions are available for provided ADCM client"""
    try:
        client.cluster_list()
    except NoSuchEndpointOrAccessIsDenied as e:
        raise AssertionError(
            'Call to get cluster list should be available for any user') from e
Exemplo n.º 2
0
def _check_client_is_unauthorized(client: ADCMClient):
    """Check that ADCM client can't perform basic actions, because session is out"""
    with pytest.raises(ErrorMessage) as e:
        client.cluster_list()
    assert (
        error_message := e.value.error.title
    ) == HTTP_401_MESSAGE, f'HTTP error should be {HTTP_401_MESSAGE}, not {error_message}'
Exemplo n.º 3
0
def _check_that_cluster_exists(sdk_client_fs: ADCMClient, cluster: Cluster) -> None:
    assert len(sdk_client_fs.cluster_list()) == 1, "Only one cluster expected to be"
    with catch_failed(ObjectNotFound, "Previously created cluster not found"):
        sdk_client_fs.cluster(name=cluster.name)