factored out test section of config

This commit is contained in:
Matthias Bisping 2022-02-25 13:10:35 +01:00
parent dca206cda5
commit b0bd9aebdf
5 changed files with 28 additions and 24 deletions

View File

@ -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"

View File

@ -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"

5
pyinfra/test/config.py Normal file
View File

@ -0,0 +1,5 @@
from pyinfra.config import Config
from pyinfra.locations import TEST_CONFIG_FILE
CONFIG = Config(TEST_CONFIG_FILE)

18
pyinfra/test/config.yaml Normal file
View File

@ -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"

View File

@ -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