aboutsummaryrefslogtreecommitdiff
path: root/tests/test_config.py
blob: 6002dd9621c9b82ff59d7833fd6c8660ea527b40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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/test_config.yaml')
        self.assertEqual(
            self.config.config_fn,
            'tests/data/test_config.yaml'
            )
        self.assertIn('backend', self.config.data)
        self.assertEqual(self.config.backend, 'memory')