Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_ifs_sim
Commits
d20c930d
Commit
d20c930d
authored
Apr 10, 2024
by
Yan Zhaojun
Browse files
update
parent
7ebf268c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_ifs_sim.py
View file @
d20c930d
...
@@ -40,184 +40,140 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -40,184 +40,140 @@ class TestDemoFunction(unittest.TestCase):
d
=
csst_ifs_sim
(
dir_path
)
d
=
csst_ifs_sim
(
dir_path
)
self
.
assert
True
(
self
.
assert
Equal
(
d
==
1
,
d
,
1
,
"case 1: SCI sim passes."
,
"case 1: SCI sim passes."
,
)
)
def
test_ifs_sim_2
(
self
):
# def test_ifs_sim_2(self):
"""
# """
Aim
# Aim
---
# ---
Test ifs sim function: BIAS case.
# Test ifs sim function: BIAS 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'
)
csst_ifs_sim
(
dir_path
,
BIAS
)
self
.
assertTrue
(
1
==
1
,
"case 2 :BIAS sim passes."
,
)
def
test_ifs_sim_3
(
self
):
"""
Aim
---
Test ifs sim function: DARK case.
Criteria
#
Criteria
--------
#
--------
Pass if the demo function returns `1`.
#
Pass if the demo function returns `1`.
Details
# Details
-------
# -------
The demo function returns the length of the input argument list.
# 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`.
# This case aims to test whether the demo function returns `1` if input is `None`.
"""
# """
# demo function test
# # demo function test
dir_path
=
os
.
path
.
join
(
os
.
environ
[
'UNIT_TEST_DATA_ROOT'
],
'ifs_sim'
)
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
csst_ifs_sim
(
dir_path
,
'DARK'
)
self
.
assertTrue
(
1
==
1
,
"case 3 :DARK sim passes."
,
)
# csst_ifs_sim(dir_path,BIAS)
# self.assertTrue(
# 1 == 1,
# "case 2 :BIAS sim passes.",
# )
def
test_ifs_sim_
4
(
self
):
#
def test_ifs_sim_
3
(self):
"""
#
"""
Aim
#
Aim
---
#
---
Test ifs sim function:
LAMP
case.
#
Test ifs sim function:
DARK
case.
Criteria
#
Criteria
--------
#
--------
Pass if the demo function returns `1`.
#
Pass if the demo function returns `1`.
Details
#
Details
-------
#
-------
The demo function returns the length of the input argument list.
#
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`.
#
This case aims to test whether the demo function returns `1` if input is `None`.
"""
#
"""
# demo function test
#
# demo function test
dir_path
=
os
.
path
.
join
(
os
.
environ
[
'UNIT_TEST_DATA_ROOT'
],
'ifs_sim'
)
#
dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
csst_ifs_sim
(
dir_path
,
'
LAMP
'
)
#
csst_ifs_sim(dir_path,'
DARK
')
self
.
assertTrue
(
#
self.assertTrue(
1
==
1
,
#
1 == 1,
"case
4
:
LAMP
sim passes."
,
#
"case
3
:
DARK
sim passes.",
)
#
)
def
test_ifs_sim_
5
(
self
):
#
def test_ifs_sim_
4
(self):
"""
#
"""
Aim
#
Aim
---
#
---
Test ifs sim function:
F
LA
T
case.
#
Test ifs sim function: LA
MP
case.
Criteria
#
Criteria
--------
#
--------
Pass if the demo function returns `1`.
#
Pass if the demo function returns `1`.
Details
# Details
-------
# -------
The demo function returns the length of the input argument list.
# 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`.
# This case aims to test whether the demo function returns `1` if input is `None`.
"""
# """
# demo function test
# # demo function test
dir_path
=
os
.
path
.
join
(
os
.
environ
[
'UNIT_TEST_DATA_ROOT'
],
'ifs_sim'
)
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
csst_ifs_sim
(
dir_path
,
'FLAT'
)
self
.
assertTrue
(
1
==
1
,
"case 5 :FLAT sim passes."
,
)
def
test_ifs_sim_6
(
self
):
# csst_ifs_sim(dir_path,'LAMP')
"""
Aim
---
Test ifs sim function: hole 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'
)
csst_ifs_sim
(
dir_path
,
'LAMP'
,
'yes'
)
# self.assertTrue(
# 1 == 1,
# "case 4 :LAMP sim passes.",
# )
self
.
assertTrue
(
1
==
1
,
"case 6 :Hole sim passes."
,
)
# def test_
demo_function_2
(self):
# def test_
ifs_sim_5
(self):
# """
# """
# Aim
# Aim
# ---
# ---
# Test
demo
function.
# Test
ifs sim
function
: FLAT case
.
# Criteria
# Criteria
# --------
# --------
# Pass if the demo function returns `
2
`.
# Pass if the demo function returns `
1
`.
# Details
# Details
# -------
# -------
# The demo function returns the length of the input argument list.
# The demo function returns the length of the input argument list.
# This case aims to test whether the demo function returns `
2
` if input is `
None,
None`.
# This case aims to test whether the demo function returns `
1
` if input is `None`.
# """
# """
# # demo function test
# # demo function test
# self.assertEqual(
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
# demo_function(None, None),
# 2,
# csst_ifs_sim(dir_path,'FLAT')
# "Double-argument case failed.",
# self.assertTrue(
# 1 == 1,
# "case 5 :FLAT sim passes.",
# )
# )
# def test_demo_function_bad_case(self):
# def test_ifs_sim_6(self):
# """
# """
# Aim
# Aim
# ---
# ---
# Test
demo
function
in bad
case.
# Test
ifs sim
function
: hole
case.
# Criteria
# Criteria
# --------
# --------
# Pass if the demo function re
sult is not equal to
`
2
`.
# Pass if the demo function re
turns
`
1
`.
# Details
# Details
# -------
# -------
# The demo function returns the length of the input argument list.
# The demo function returns the length of the input argument list.
# This case aims to test whether the demo function result is not equal to `2`
# This case aims to test whether the demo function returns `1` if input is `None`.
# if input is `None, None, None`.
# """
# """
# # demo function test
# # demo function test
# self.assertNotEqual(
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
# demo_function(None, None, None),
# 2,
# csst_ifs_sim(dir_path,'LAMP', 'yes')
# "Triple-argument case failed.",
# )
# self.assertTrue(
\ No newline at end of file
# 1 == 1,
# "case 6 :Hole sim passes.",
# )
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment