-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADCM-6278 Added a sample implementation of the examples
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from collections.abc import Generator | ||
|
||
import pytest_asyncio | ||
|
||
from adcm_aio_client.objects import Bundle | ||
from tests.integration.setup_environment import ADCMContainer | ||
|
||
TIMEOUT = 10 | ||
RETRY_INTERVAL = 1 | ||
RETRY_ATTEMPTS = 1 | ||
|
||
|
||
@pytest_asyncio.fixture() | ||
def adcm( | ||
adcm: ADCMContainer, | ||
simple_cluster_bundle: Bundle, | ||
complex_cluster_bundle: Bundle, | ||
previous_complex_cluster_bundle: Bundle, | ||
simple_hostprovider_bundle: Bundle, | ||
) -> Generator[ADCMContainer, None, None]: | ||
_ = simple_cluster_bundle, complex_cluster_bundle, previous_complex_cluster_bundle, simple_hostprovider_bundle | ||
yield adcm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
|
||
from adcm_aio_client import ADCMSession, Credentials | ||
from tests.integration.examples.conftest import RETRY_ATTEMPTS, RETRY_INTERVAL, TIMEOUT | ||
from tests.integration.setup_environment import ADCMContainer | ||
|
||
pytestmark = [pytest.mark.asyncio] | ||
|
||
|
||
async def test_iteration_with_cluster(adcm: ADCMContainer) -> None: | ||
""" | ||
Interaction with clusters: creating, deleting, getting a list of clusters using filtering, | ||
configuring cluster configuration, launching actions on the cluster and updating the cluster. | ||
""" | ||
url = adcm.url | ||
credentials = Credentials(username="admin", password="admin") # noqa: S106 | ||
|
||
async with ADCMSession( | ||
url=url, credentials=credentials, timeout=TIMEOUT, retry_attempts=RETRY_ATTEMPTS, retry_interval=RETRY_INTERVAL | ||
) as client: | ||
clusters = await client.clusters.all() | ||
assert len(clusters) == 0 |