53 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Python
		
	
	
	
		
		
			
		
	
	
			53 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Python
		
	
	
	
| 
								 | 
							
								# coding=utf-8
							 | 
						||
| 
								 | 
							
								import unittest
							 | 
						||
| 
								 | 
							
								from sys_config import SysConfig
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class TestSysConfig(unittest.TestCase):
							 | 
						||
| 
								 | 
							
								    def setUp(self):
							 | 
						||
| 
								 | 
							
								        self.config = SysConfig()
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_eps_path(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.eps_path(), u'C:/EPS20221017/eps.exe')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_python_path(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.python_path(), u'C:/Python27/ArcGIS10.2/python.exe')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_template_name(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.template_name(), u'"上海新型测绘500.mdt"')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_sde_scheme(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.sde_scheme(), "SHDLG500")
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_eps_show_window(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.eps_show_window(), u'show')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_sync_mode(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.sync_mode(), 1)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_sync_type(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.sync_type(), u'ALL')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_updateregion(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.updateregion(), u'UpdateRegion_A')  # "UpdateRegion_A"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_updatetime_field(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.updatetime_field(), u'UpdateTime')  # u'UpdateTime'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_updatetime_field_history(self):
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.updatetime_field_history(), u'DeleteTime')  # u'DeleteTime'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    def test_attr(self):
							 | 
						||
| 
								 | 
							
								        self.config.is_debug = True
							 | 
						||
| 
								 | 
							
								        self.config.changed_layers_only = 1
							 | 
						||
| 
								 | 
							
								        self.config.last_sync_datetime = "1990-05-11 12:00:00"
							 | 
						||
| 
								 | 
							
								        self.config.curr_sync_datetime = "2023-05-11 12:00:00"
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.is_debug, True)
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.changed_layers_only, 1)
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.last_sync_datetime, "1990-05-11 12:00:00")
							 | 
						||
| 
								 | 
							
								        self.assertEqual(self.config.curr_sync_datetime, "2023-05-11 12:00:00")
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if __name__ == '__main__':
							 | 
						||
| 
								 | 
							
								    unittest.main()
							 |