Loading tests/test_ifs_sim.py +91 −135 Original line number Original line Diff line number Diff line Loading @@ -40,184 +40,140 @@ class TestDemoFunction(unittest.TestCase): d=csst_ifs_sim(dir_path) d=csst_ifs_sim(dir_path) self.assertTrue( self.assertEqual( 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 -------- 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. 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,BIAS) self.assertTrue( # self.assertTrue( 1 == 1, # 1 == 1, "case 4 :LAMP sim passes.", # "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): # Details """ # ------- Aim # 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`. Test ifs sim function: FLAT case. # """ # # demo function test # dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim') Criteria # csst_ifs_sim(dir_path,'DARK') -------- Pass if the demo function returns `1`. Details # self.assertTrue( ------- # 1 == 1, The demo function returns the length of the input argument list. # "case 3 :DARK sim passes.", 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,'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): # Criteria """ # -------- Aim # Pass if the demo function returns `1`. --- Test ifs sim function: hole case. Criteria # Details -------- # ------- Pass if the demo function returns `1`. # 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 # csst_ifs_sim(dir_path,'LAMP') ------- 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 result is not equal to `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 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( # 1 == 1, # "case 6 :Hole sim passes.", # ) # ) No newline at end of file Loading
tests/test_ifs_sim.py +91 −135 Original line number Original line Diff line number Diff line Loading @@ -40,184 +40,140 @@ class TestDemoFunction(unittest.TestCase): d=csst_ifs_sim(dir_path) d=csst_ifs_sim(dir_path) self.assertTrue( self.assertEqual( 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 -------- 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. 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,BIAS) self.assertTrue( # self.assertTrue( 1 == 1, # 1 == 1, "case 4 :LAMP sim passes.", # "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): # Details """ # ------- Aim # 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`. Test ifs sim function: FLAT case. # """ # # demo function test # dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim') Criteria # csst_ifs_sim(dir_path,'DARK') -------- Pass if the demo function returns `1`. Details # self.assertTrue( ------- # 1 == 1, The demo function returns the length of the input argument list. # "case 3 :DARK sim passes.", 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,'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): # Criteria """ # -------- Aim # Pass if the demo function returns `1`. --- Test ifs sim function: hole case. Criteria # Details -------- # ------- Pass if the demo function returns `1`. # 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 # csst_ifs_sim(dir_path,'LAMP') ------- 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 result is not equal to `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 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( # 1 == 1, # "case 6 :Hole sim passes.", # ) # ) No newline at end of file