shsmi_sysdb_nex/test/test_functions.py

26 lines
855 B
Python
Raw Normal View History

2023-05-27 15:47:41 +08:00
# coding=utf-8
import unittest
2023-05-29 18:10:37 +08:00
from imp import reload
2023-05-27 15:47:41 +08:00
from functions import *
2023-05-29 18:10:37 +08:00
reload(sys)
sys.setdefaultencoding('utf8')
parent_path = os.path.abspath(os.path.dirname(os.getcwd()))
2023-05-27 15:47:41 +08:00
class TestFunctions(unittest.TestCase):
def test_run_command(self):
python_path = str(u'C:/Python27/ArcGIS10.2/python.exe ').encode('gb2312')
2023-05-29 18:10:37 +08:00
script = str(parent_path + '\\sde_fc2fc.py ')
2023-05-27 15:47:41 +08:00
type_cmd = str(u'feature ').encode('gb2312')
fc_name_cmd = str(u'Building_A ').encode('gb2312')
out_cmd = str(u'Building_A ').encode('gb2312')
fc_cur_cmd = str(u'Building_A ').encode('gb2312')
# exp_cmd = str(u'"" ')
command_string = python_path + script + type_cmd + fc_name_cmd + out_cmd + fc_cur_cmd
rst, out = run_command(command_string)
print(out)
self.assertEqual(rst, True)