Newer
Older
"""
Identifier: ifs_sim/tests/test_ifs_sim.py
Name: test_ifs_sim.py
Description: Test ifs sim.
Author: Zhaojun Yan
Created: 2024-04-09
Modified-History:
2024-04-09, Zhaojun Yan, created
"""
import unittest
class TestDemoFunction(unittest.TestCase):
def test_ifs_sim_1(self):
"""
Aim
---
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
dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
# ##############################################################
# def test_ifs_sim_2(self):
# """
# Aim
# ---
# Test ifs sim function: SCI case.
# 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
# dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
# print(dir_path)
# print(sys.version )
# ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
# configfile = './csst_ifs_sim/ifs_data/IFS_sim_C90.config'
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# debug=True
# result_path=dir_path+'ifs_sim_result'
# csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
# self.assertEqual(
# 1 , 1,
# "case 2: sim passes.",
# )
# ###################################################################
# def test_ifs_sim_3(self):
# """
# Aim
# ---
# Test ifs sim function: SCI case.
# 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
# dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
# print(dir_path)
# print(sys.version )
# ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
# configfile = './csst_ifs_sim/ifs_data/IFS_sim_C90.config'
# csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
# self.assertEqual(
# 1 , 1,
# "case 3: sim passes.",
# )
# ###################################################################
# def test_ifs_sim_4(self):
# """
# Aim
# ---
# Test ifs sim function: SCI case.
# 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
# dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
# print(dir_path)
# print(sys.version )
# ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
# configfile = './csst_ifs_sim/ifs_data/IFS_sim_C90.config'
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# debug=True
# result_path=dir_path+'ifs_sim_result'
# csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
# self.assertEqual(
# 1 , 1,
# "case 4: sim passes.",
# )
# ###################################################################
# def test_ifs_sim_5(self):
# """
# Aim
# ---
# Test ifs sim function: SCI case.
# 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
# dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
# print(dir_path)
# print(sys.version )
# ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
# configfile = './csst_ifs_sim/ifs_data/IFS_sim_C90.config'
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# debug=True
# result_path=dir_path+'ifs_sim_result'
# csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'yes')
# self.assertEqual(
# 1 , 1,
# "case 5: sim passes.",
# )
# ###################################################################
# def test_ifs_sim_6(self):
# """
# Aim
# ---
# Test ifs sim function: SCI case.
# 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
# dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
# print(dir_path)
# print(sys.version )
# ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
# configfile = './csst_ifs_sim/ifs_data/IFS_sim_C90.config'
# csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug, 'no')
# self.assertEqual(
# 1 , 1,
# "case 6: sim passes.",
# )