diff --git a/config.yaml b/config.yaml index acad3be..4530512 100755 --- a/config.yaml +++ b/config.yaml @@ -38,22 +38,3 @@ probing_webserver: host: $PROBING_WEBSERVER_HOST|"0.0.0.0" # Probe webserver address port: $PROBING_WEBSERVER_PORT|8080 # Probe webserver port mode: $PROBING_WEBSERVER_MODE|production # webserver mode: {development, production} - -test: - minio: - s3: - endpoint: "http://127.0.0.1:9000" - access_key: root - secret_key: password - - aws: - s3: - endpoint: https://s3.amazonaws.com - access_key: AKIA4QVP6D4LCDAGYGN2 - secret_key: 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 - - azure: - azure_blob_storage: - connection_string: "DefaultEndpointsProtocol=https;AccountName=iqserdevelopment;AccountKey=4imAbV9PYXaztSOMpIyAClg88bAZCXuXMGJG0GA1eIBpdh2PlnFGoRBnKqLy2YZUSTmZ3wJfC7tzfHtuC6FEhQ==;EndpointSuffix=core.windows.net" - - bucket: "pyinfra-test-bucket" diff --git a/pyinfra/locations.py b/pyinfra/locations.py index 330da8b..5183a8b 100644 --- a/pyinfra/locations.py +++ b/pyinfra/locations.py @@ -4,11 +4,11 @@ from pathlib import Path MODULE_DIR = Path(__file__).resolve().parents[0] + PACKAGE_ROOT_DIR = MODULE_DIR.parents[0] -DOCKER_COMPOSE_FILE = PACKAGE_ROOT_DIR.joinpath("docker-compose.yaml") +TEST_DIR = MODULE_DIR / "test" -CONFIG_FILE = PACKAGE_ROOT_DIR.joinpath("config.yaml") -LOG_FILE = Path("/tmp/log.log") +CONFIG_FILE = PACKAGE_ROOT_DIR / "config.yaml" -DATA_DIR = PACKAGE_ROOT_DIR.joinpath("data") +TEST_CONFIG_FILE = TEST_DIR / "config.yaml" diff --git a/pyinfra/test/config.py b/pyinfra/test/config.py new file mode 100644 index 0000000..c8058f1 --- /dev/null +++ b/pyinfra/test/config.py @@ -0,0 +1,5 @@ +from pyinfra.config import Config +from pyinfra.locations import TEST_CONFIG_FILE + + +CONFIG = Config(TEST_CONFIG_FILE) diff --git a/pyinfra/test/config.yaml b/pyinfra/test/config.yaml new file mode 100644 index 0000000..948062a --- /dev/null +++ b/pyinfra/test/config.yaml @@ -0,0 +1,18 @@ +test: + minio: + s3: + endpoint: "http://127.0.0.1:9000" + access_key: root + secret_key: password + + aws: + s3: + endpoint: https://s3.amazonaws.com + access_key: AKIA4QVP6D4LCDAGYGN2 + secret_key: 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 + + azure: + azure_blob_storage: + connection_string: "DefaultEndpointsProtocol=https;AccountName=iqserdevelopment;AccountKey=4imAbV9PYXaztSOMpIyAClg88bAZCXuXMGJG0GA1eIBpdh2PlnFGoRBnKqLy2YZUSTmZ3wJfC7tzfHtuC6FEhQ==;EndpointSuffix=core.windows.net" + + bucket: "pyinfra-test-bucket" diff --git a/pyinfra/test/unit_tests/storage_test.py b/pyinfra/test/unit_tests/storage_test.py index f0fa9ff..1d9840c 100644 --- a/pyinfra/test/unit_tests/storage_test.py +++ b/pyinfra/test/unit_tests/storage_test.py @@ -2,7 +2,7 @@ import logging import pytest -from pyinfra.config import CONFIG +from pyinfra.test.config import CONFIG from pyinfra.exceptions import UnknownClient from pyinfra.storage.adapters.azure import AzureStorageAdapter from pyinfra.storage.adapters.s3 import S3StorageAdapter