test_zodiacal.py 1.24 KB
Newer Older
Yan Zhaojun's avatar
debug  
Yan Zhaojun 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
38
39
40
41
42
43
44
"""
Identifier:     mci_sim/tests/test_zodiacal.py
Name:           test_zodiacal.py
Description:    Test zodiacal sim.
Author:         Zhaojun Yan
Created:        2024-04-09
Modified-History:
    2024-04-09, Zhaojun Yan, created

"""

import unittest
import os
import sys
import faulthandler
from csst_mci_sim import zodiacal


class TestDemoFunction(unittest.TestCase):
    def test_zodiacal(self):
        """
        Aim
        ---
        Test zodiacal sim 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`.
        """
        faulthandler.enable()

        # demo function test
        dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'], 'mci_sim/')
        print(dir_path)

        # 获取当前工作目录
        # current_path = os.getcwd()
        # print("当前路径:", current_path)

Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
45
        wave0, zodi0=zodiacal.zodiacal(10.0, 20.0, '2024-04-04', dir_path)
Yan Zhaojun's avatar
debug  
Yan Zhaojun committed
46
47
48

        self.assertEqual(
            1, 1,
Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
49
            "case 1: test_zodiacal passes.",
Yan Zhaojun's avatar
debug  
Yan Zhaojun committed
50
51
        )
    #############################################