aboutsummaryrefslogtreecommitdiff
path: root/tests/test_config.py
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2019-04-13 18:26:34 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2019-04-13 18:26:34 +0200
commit9b337be1a6e392923509fa94435164b0da98960d (patch)
tree1b77c63077c7fc53a4a41c01c01de418cbe24b73 /tests/test_config.py
parent771ce2a2edff6f8e065b2757066778e3fb1b765a (diff)
Add test infrastructure
Diffstat (limited to 'tests/test_config.py')
-rw-r--r--tests/test_config.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
new file mode 100644
index 0000000..37f057e
--- /dev/null
+++ b/tests/test_config.py
@@ -0,0 +1,22 @@
+import unittest
+
+from pyapd import config
+
+
+class TestConfig(unittest.TestCase):
+ def setUp(self):
+ self.config = config.Config()
+
+ def test_load_config_no_files(self):
+ self.config.load()
+ self.assertEqual(self.config.config_fn, 'pyapd_config.yaml')
+ self.assertIn('backend', self.config.data)
+
+ def test_load_config_from_file(self):
+ self.config.load('tests/data/simple_config.yaml')
+ self.assertEqual(
+ self.config.config_fn,
+ 'tests/data/simple_config.yaml'
+ )
+ self.assertIn('backend', self.config.data)
+ self.assertEqual(self.config.backend, 'none')