test: use fixture for default conf
diff --git a/atmosphere/tests/conftest.py b/atmosphere/tests/conftest.py
index a678d84..c830701 100644
--- a/atmosphere/tests/conftest.py
+++ b/atmosphere/tests/conftest.py
@@ -4,6 +4,19 @@
import pytest
import requests
+from atmosphere.models import config
+
+
+@pytest.fixture
+def sample_config():
+ return config.Config(
+ {
+ "memcached": {
+ "secret_key": "foobar",
+ }
+ }
+ )
+
@pytest.fixture
def pykube(mocker):
diff --git a/atmosphere/tests/integration/test_deploy.py b/atmosphere/tests/integration/test_deploy.py
index 9d0210d..9c9fffb 100644
--- a/atmosphere/tests/integration/test_deploy.py
+++ b/atmosphere/tests/integration/test_deploy.py
@@ -1,14 +1,13 @@
import pykube
from atmosphere import flows
-from atmosphere.models import config
def test_kubernetes_version(flux_cluster):
assert flux_cluster.api.version == ("1", "25")
-def test_deployment(mocker, flux_cluster):
+def test_deployment(sample_config, mocker, flux_cluster):
mocker.patch("atmosphere.clients.get_pykube_api", return_value=flux_cluster.api)
flux_cluster.kubectl("create", "namespace", "openstack")
@@ -16,8 +15,7 @@
"label", "node", "pytest-kind-control-plane", "openstack-control-plane=enabled"
)
- cfg = config.Config.get_mock_object()
- engine = flows.get_engine(cfg)
+ engine = flows.get_engine(sample_config)
engine.run()
initial_memcache_secret = pykube.Secret.objects(
@@ -25,8 +23,8 @@
).get_by_name("atmosphere-memcached")
assert initial_memcache_secret.exists()
- cfg.memcached.secret_key = "not-secret"
- engine = flows.get_engine(cfg)
+ sample_config.memcached.secret_key = "not-secret"
+ engine = flows.get_engine(sample_config)
engine.run()
updated_memcache_secret = pykube.Secret.objects(