salt-ext-modules-vmware icon indicating copy to clipboard operation
salt-ext-modules-vmware copied to clipboard

use pytest fixture for test datastore lookup instead of integration_test_config

Open dhiltonp opened this issue 3 years ago • 0 comments

tests/integration/modules/test_datastore.py and tests/integration/states/test_datastore.py both use integration_test_config["datastores"].

We should modify those tests to get a datastore name (cached using a pytest fixture?), then modify it/restore its state; something like:

@pytest.fixture(scope="session")
def datastore(service_instance, integration_test_config):
     host = integration_test_config["esxi_host_name"]

    datastores = datastore.get(
        service_instance=service_instance,
        host_name=host,
    )

    return datastores[0]

dhiltonp avatar Feb 07 '22 15:02 dhiltonp