2023-05-27 15:47:41 +08:00
|
|
|
# coding=utf-8
|
|
|
|
import unittest
|
|
|
|
from functions import *
|
|
|
|
|
|
|
|
|
|
|
|
class TestFunctions(unittest.TestCase):
|
|
|
|
def test_run_command(self):
|
|
|
|
python_path = str(u'C:/Python27/ArcGIS10.2/python.exe ').encode('gb2312')
|
|
|
|
script = str(u'sde_fc2fc.py ').encode('gb2312')
|
|
|
|
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)
|
2023-05-29 17:27:23 +08:00
|
|
|
|
|
|
|
|