Commit 5d3ba19f authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

more case test

parent fedab925
Loading
Loading
Loading
Loading
Loading
+156 −122
Original line number Original line Diff line number Diff line
@@ -48,135 +48,169 @@ class TestDemoFunction(unittest.TestCase):
            "case 1: SCI sim passes.",
            "case 1: SCI sim passes.",
        )
        )
        
        
        ##############################################################
    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 = './ifs_data/IFS_sim_C90.config'
      
        sourcein = 'BIAS'
        print(configfile)
                
        csst_ifs_sim.runIFSsim(sourcein,  configfile, dir_path, 1, 'no')
        self.assertEqual(
            1 , 1,
            "case 2:  sim passes.",
        )
        
        
    # def test_ifs_sim_2(self):
        ###################################################################
    #     """
        def test_ifs_sim_3(self):
    #     Aim
            """
    #     ---
            Aim
    #     Test ifs sim function: BIAS case.
            ---
            Test ifs sim function: SCI case.

            Criteria
            --------
            Pass if the demo function returns `1`.


    #     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`.
    #     Details
            """
    #     -------
            # demo function test
    #     The demo function returns the length of the input argument list.
            dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
    #     This case aims to test whether the demo function returns `1` if input is `None`.
            print(dir_path)
    #     """
            print(sys.version )
    #     # demo function test
            ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
    #     dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
            
        
            configfile = './ifs_data/IFS_sim_C90.config'
    #     csst_ifs_sim(dir_path,BIAS)
          
        
            sourcein = 'DARK'
    #     self.assertTrue(
            print(configfile)
    #         1 == 1,
                    
    #         "case 2 :BIAS sim passes.",
            csst_ifs_sim.runIFSsim(sourcein,  configfile, dir_path, 1, 'no')
    #     )
            self.assertEqual(
        
                1 , 1,
    # def test_ifs_sim_3(self):
                "case 3:  sim passes.",
    #     """
            )
    #     Aim
                
    #     ---
        ###################################################################
    #     Test ifs sim function: DARK case.
        def test_ifs_sim_4(self):

            """
    #     Criteria
            Aim
    #     --------
            ---
    #     Pass if the demo function returns `1`.
            Test ifs sim function: SCI case.


    #     Details
            Criteria
    #     -------
            --------
    #     The demo function returns the length of the input argument list.
            Pass if the demo function returns `1`.
    #     This case aims to test whether the demo function returns `1` if input is `None`.

    #     """
            Details
    #     # demo function test
            -------
    #     dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
            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`.
    #     csst_ifs_sim(dir_path,'DARK')
            """
        
            # demo function test
    #     self.assertTrue(
            dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
    #         1 == 1,
            print(dir_path)
    #         "case 3 :DARK sim passes.",
            print(sys.version )
    #     )
            ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
        
            
        
            configfile = './ifs_data/IFS_sim_C90.config'
        
          
    # def test_ifs_sim_4(self):
            sourcein = 'LAMP'
    #     """
            print(configfile)
    #     Aim
                    
    #     ---
            csst_ifs_sim.runIFSsim(sourcein,  configfile, dir_path, 1, 'no')
    #     Test ifs sim function: LAMP case.
            self.assertEqual(

                1 , 1,
    #     Criteria
                "case 4:  sim passes.",
    #     --------
            )  
    #     Pass if the demo function returns `1`.
            

        ###################################################################
    #     Details
        def test_ifs_sim_5(self):
    #     -------
            """
    #     The demo function returns the length of the input argument list.
            Aim
    #     This case aims to test whether the demo function returns `1` if input is `None`.
            ---
    #     """
            Test ifs sim function: SCI case.
    #     # demo function test

    #     dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
            Criteria
        
            --------
    #     csst_ifs_sim(dir_path,'LAMP')
            Pass if the demo function returns `1`.
        

    #     self.assertTrue(
            Details
    #         1 == 1,
            -------
    #         "case 4 :LAMP sim passes.",
            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/')
    # def test_ifs_sim_5(self):
            print(dir_path)
    #     """
            print(sys.version )
    #     Aim
            ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
    #     ---
            
    #     Test ifs sim function: FLAT case.
            configfile = './ifs_data/IFS_sim_C90.config'

          
    #     Criteria
            sourcein = 'LAMP'
    #     --------
            print(configfile)
    #     Pass if the demo function returns `1`.
                    

            csst_ifs_sim.runIFSsim(sourcein,  configfile, dir_path, 1, 'yes')
    #     Details
            self.assertEqual(
    #     -------
                1 , 1,
    #     The demo function returns the length of the input argument list.
                "case 5:  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')
        def test_ifs_sim_6(self):
        
            """
    #     csst_ifs_sim(dir_path,'FLAT')
            Aim
        
            ---
    #     self.assertTrue(
            Test ifs sim function: SCI case.
    #         1 == 1,

    #         "case 5 :FLAT sim passes.",
            Criteria
    #     )
            --------
        
            Pass if the demo function returns `1`.
        

    # def test_ifs_sim_6(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: hole case.
            """
    
            # demo function test
    #     Criteria
            dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
    #     --------
            print(dir_path)
    #     Pass if the demo function returns `1`.
            print(sys.version )
    
            ###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
    #     Details
            
    #     -------
            configfile = './ifs_data/IFS_sim_C90.config'
    #     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`.
            sourcein = 'FLAT'
    #     """
            print(configfile)
    #     # demo function test
                    
    #     dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
            csst_ifs_sim.runIFSsim(sourcein,  configfile, dir_path, 1, 'no')
        
            self.assertEqual(
    #     csst_ifs_sim(dir_path,'LAMP', 'yes')
                1 , 1,
        
                "case 6:  sim passes.",
    #     self.assertTrue(
            )
    #         1 == 1,
    #         "case 6 :Hole sim passes.",
    #     )
            
            
         
         
 No newline at end of file