add pytests to check if a configured bucket can be found
This commit is contained in:
parent
5b948fdcc5
commit
843d91c61a
15
tests/conftest.py
Normal file
15
tests/conftest.py
Normal file
@ -0,0 +1,15 @@
|
||||
from distutils.command.config import config
|
||||
import pytest
|
||||
from pyinfra.config import get_config
|
||||
import os
|
||||
|
||||
@pytest.fixture(params=)
|
||||
def storage_config(request):
|
||||
if request.param == "s3":
|
||||
os.environ["STORAGE_BACKEND"] = "s3"
|
||||
os.environ["STORAGE_BUCKET_NAME"] = "pyinfra-test-bucket"
|
||||
else:
|
||||
os.environ["STORAGE_BACKEND"] = "aks"
|
||||
os.environ["STORAGE_AZURECONTAINERNAME"] = "pyinfra-test-bucket"
|
||||
|
||||
return get_config()
|
||||
5
tests/test_storage.py
Normal file
5
tests/test_storage.py
Normal file
@ -0,0 +1,5 @@
|
||||
from pyinfra.storage import get_storage
|
||||
|
||||
def test_storage(storage_config) -> None:
|
||||
storage = get_storage(storage_config)
|
||||
assert storage.has_bucket(storage_config.storage_bucket)
|
||||
Loading…
x
Reference in New Issue
Block a user