aboutsummaryrefslogtreecommitdiff
path: root/tests/test_app.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_app.py')
-rw-r--r--tests/test_app.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_app.py b/tests/test_app.py
index 6d96fbb..6cf29c5 100644
--- a/tests/test_app.py
+++ b/tests/test_app.py
@@ -1,4 +1,6 @@
+import os
import unittest
+import unittest.mock
from kerbana import config, create_app
@@ -12,3 +14,14 @@ class TestBase(unittest.TestCase):
def test_root(self):
res = self.client.get("/")
self.assertEqual("Hello World!", res.data.decode())
+
+
+class TestConfig(unittest.TestCase):
+ def test_default_config(self):
+ app = create_app()
+ self.assertEqual(app.config["SECRET_KEY"], "dev")
+
+ @unittest.mock.patch.dict(os.environ, {"KERBANA_CONFIG": "no_such_file"})
+ def test_kerbana_config_env_non_existing(self):
+ app = create_app()
+ self.assertEqual(app.config["SECRET_KEY"], "dev")