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
Show whitespace changes
Inline
Side-by-side
tests/test_ifs_sim.py
View file @
d20c930d
...
...
@@ -40,184 +40,140 @@ class TestDemoFunction(unittest.TestCase):
d
=
csst_ifs_sim
(
dir_path
)
self
.
assert
True
(
d
==
1
,
self
.
assert
Equal
(
d
,
1
,
"case 1: SCI sim passes."
,
)
def
test_ifs_sim_2
(
self
):
"""
Aim
---
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
--------
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
,
'DARK'
)
self
.
assertTrue
(
1
==
1
,
"case 3 :DARK sim passes."
,
)
def
test_ifs_sim_4
(
self
):
"""
Aim
---
Test ifs sim function: LAMP case.
# def test_ifs_sim_2(self):
# """
# Aim
# ---
# Test ifs sim function: BIAS case.
Criteria
--------
Pass if the demo function returns `1`.
#
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'
)
#
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'
)
#
csst_ifs_sim(dir_path,
BIAS
)
self
.
assertTrue
(
1
==
1
,
"case
4
:
LAMP
sim passes."
,
)
#
self.assertTrue(
#
1 == 1,
#
"case
2
:
BIAS
sim passes.",
#
)
# def test_ifs_sim_3(self):
# """
# Aim
# ---
# Test ifs sim function: DARK case.
# Criteria
# --------
# Pass if the demo function returns `1`.
def
test_ifs_sim_5
(
self
):
"""
Aim
---
Test ifs sim function: FLAT case.
# 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')
Criteria
--------
Pass if the demo function returns `1`.
# csst_ifs_sim(dir_path,'DARK')
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'
)
# self.assertTrue(
# 1 == 1,
# "case 3 :DARK sim passes.",
# )
csst_ifs_sim
(
dir_path
,
'FLAT'
)
self
.
assertTrue
(
1
==
1
,
"case 5 :FLAT sim passes."
,
)
# def test_ifs_sim_4(self):
# """
# Aim
# ---
# Test ifs sim function: LAMP case.
def
test_ifs_sim_6
(
self
):
"""
Aim
---
Test ifs sim function: hole case.
# Criteria
# --------
# Pass if the demo function returns `1`.
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')
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')
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
# ---
# Test
demo
function.
# Test
ifs sim
function
: FLAT case
.
# Criteria
# --------
# Pass if the demo function returns `
2
`.
# 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 `
2
` if input is `
None,
None`.
# This case aims to test whether the demo function returns `
1
` if input is `None`.
# """
# # demo function test
# self.assertEqual(
# demo_function(None, None),
# 2,
# "Double-argument case failed.",
# 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_demo_function_bad_case(self):
# def test_ifs_sim_6(self):
# """
# Aim
# ---
# Test
demo
function
in bad
case.
# Test
ifs sim
function
: hole
case.
# Criteria
# --------
# Pass if the demo function re
sult is not equal to
`
2
`.
# Pass if the demo function re
turns
`
1
`.
# Details
# -------
# 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`
# if input is `None, None, None`.
# This case aims to test whether the demo function returns `1` if input is `None`.
# """
# # demo function test
# self.assertNotEqual(
# demo_function(None, None, None),
# 2,
# "Triple-argument case failed.",
# 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 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