You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					51 lines
				
				1.4 KiB
			
		
		
			
		
	
	
					51 lines
				
				1.4 KiB
			| 
								 
											3 years ago
										 
									 | 
							
								import unittest
							 | 
						||
| 
								 | 
							
								import os
							 | 
						||
| 
								 | 
							
								import inspect
							 | 
						||
| 
								 | 
							
								import utils.path_tool
							 | 
						||
| 
								 | 
							
								import basic.program
							 | 
						||
| 
								 | 
							
								import basic.constants as B
							 | 
						||
| 
								 | 
							
								import test.constants
							 | 
						||
| 
								 | 
							
								import test.testtools
							 | 
						||
| 
								 | 
							
								import utils.path_const as P
							 | 
						||
| 
								 | 
							
								import basic.catalog
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								HOME_PATH = test.constants.HOME_PATH
							 | 
						||
| 
								 | 
							
								OS_SYSTEM = test.constants.OS_SYSTEM
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# here you can select single testfunction for developping the tests
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								TEST_FUNCTIONS = ["test_01class",  "test_02key"]
							 | 
						||
| 
								 | 
							
								#TEST_FUNCTIONS = [ "test_02key"]
							 | 
						||
| 
								 | 
							
								verbose = True
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								class MyTestCase(unittest.TestCase):
							 | 
						||
| 
								 | 
							
								    mymsg = "--------------------------------------------------------------"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								    def test_01class(self):
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								        global mymsg
							 | 
						||
| 
								 | 
							
								        actfunction = str(inspect.currentframe().f_code.co_name)
							 | 
						||
| 
								 | 
							
								        cnttest = 0
							 | 
						||
| 
								 | 
							
								        if actfunction not in TEST_FUNCTIONS:
							 | 
						||
| 
								 | 
							
								            return
							 | 
						||
| 
								 | 
							
								        job = test.testtools.getJob()
							 | 
						||
| 
								 | 
							
								        catalog = basic.catalog.Catalog.getInstance()
							 | 
						||
| 
								 | 
							
								        self.assertIsNotNone(catalog)
							 | 
						||
| 
								 | 
							
								        MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								    def test_02key(self):
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								        global mymsg
							 | 
						||
| 
								 | 
							
								        actfunction = str(inspect.currentframe().f_code.co_name)
							 | 
						||
| 
								 | 
							
								        cnttest = 0
							 | 
						||
| 
								 | 
							
								        if actfunction not in TEST_FUNCTIONS:
							 | 
						||
| 
								 | 
							
								            return
							 | 
						||
| 
								 | 
							
								        job = test.testtools.getJob()
							 | 
						||
| 
								 | 
							
								        MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_zzz(self):
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								        if verbose: print(MyTestCase.mymsg)
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if __name__ == '__main__':
							 | 
						||
| 
								 | 
							
								    unittest.main()
							 |