test_config.py 987 Bytes
Newer Older
BO ZHANG's avatar
BO ZHANG committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
Identifier:     csst_proto/test_config.py
Name:           test_config.py
Description:    Test reading toml format config.
Author:         Bo Zhang
Created:        2023-10-26
Modified-History:
    2023-10-26, Bo Zhang, created
    2023-10-26, Bo Zhang, add module header
"""

import unittest
from csst_proto import read_config


class TestDemoFunction(unittest.TestCase):
    def test_read_config(self):
        """
        Aim
        ---
        Test demo function.

        Criteria
        --------
        Pass if the demo function returns `1`.

        Details
        -------
        The demo function returns the length of the input argument list.
        This case aims to test whether the demo function returns `1` if input is `None`.
        """
        # demo function test
        config = read_config()
        self.assertTrue(
            set(config.keys()) == {"A", "B"} and config["A"] == 1 and config["B"] == 2,
            "Single-argument case failed.",
        )