From 3c33ddd2f85ac5475539cd1c5eae2f30fb9e6ea8 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Sat, 13 Apr 2019 18:32:19 +0200 Subject: Config for tests --- tests/data/simple_config.yaml | 1 - tests/data/test_config.yaml | 1 + tests/test_app.py | 4 ++-- tests/test_config.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 tests/data/simple_config.yaml create mode 100644 tests/data/test_config.yaml (limited to 'tests') diff --git a/tests/data/simple_config.yaml b/tests/data/simple_config.yaml deleted file mode 100644 index fa44e32..0000000 --- a/tests/data/simple_config.yaml +++ /dev/null @@ -1 +0,0 @@ -backend: none diff --git a/tests/data/test_config.yaml b/tests/data/test_config.yaml new file mode 100644 index 0000000..fa44e32 --- /dev/null +++ b/tests/data/test_config.yaml @@ -0,0 +1 @@ +backend: none diff --git a/tests/test_app.py b/tests/test_app.py index a2ff27a..1ff504c 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1,11 +1,11 @@ from tornado.testing import AsyncHTTPTestCase -from pyapd import app +from pyapd import app, config class TestApp(AsyncHTTPTestCase): def get_app(self, *args, **kw): - return app.App() + return app.App(config.Config('tests/data/test_config.yaml')) def test_root(self): res = self.fetch('/') diff --git a/tests/test_config.py b/tests/test_config.py index 37f057e..7851019 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -13,10 +13,10 @@ class TestConfig(unittest.TestCase): self.assertIn('backend', self.config.data) def test_load_config_from_file(self): - self.config.load('tests/data/simple_config.yaml') + self.config.load('tests/data/test_config.yaml') self.assertEqual( self.config.config_fn, - 'tests/data/simple_config.yaml' + 'tests/data/test_config.yaml' ) self.assertIn('backend', self.config.data) self.assertEqual(self.config.backend, 'none') -- cgit v1.2.3