def test_overhaulplan_create_month(self):
     u'''按月单位创建大修单'''
     interfaceurl = 'http://' + domain + ':' + port + '/ime-container/imeOverhaulPlan/planSave.action'
     cdata = {
         "smDepartmentGid":
         excel.excel_find('DepartmentGid'),
         "smDepartmentName":
         "自动化测试",
         "startDate":
         "2017-12-30",
         "endDate":
         "2018-02-03",
         "type":
         "year_check",
         "imeOverhaulPlanInfoList": [{
             "eventPayload": {},
             "content": "大修内容",
             "cycle": "1",
             "cycleUnit": "month",
             "standard": "大修标准"
         }]
     }
     opcreq = requests.post(interfaceurl,
                            headers=headers,
                            data=json.dumps(cdata)).content.decode()
     opgid = json.loads(opcreq)['data']
     sreq = overhaulplan_public.overhaulplan_select(opgid)
     if opgid in sreq:
         assert 1 == 1
     else:
         assert 1 == 2
 def test_overhaulplan_select_detail(self):
     u'''查询大修计划详情'''
     # 新建大修计划
     opgid = overhaulplan_public.overhaulplan_create()
     sreq = overhaulplan_public.overhaulplan_select(opgid)
     if opgid in sreq:
         assert 1 == 1
     else:
         assert 1 == 2
 def test_overhaulplan_delete_simple(self):
     u'''单个删除大修计划'''
     opgids = []
     opgid = overhaulplan_public.overhaulplan_create()
     opgids.append(opgid)
     overhaulplan_public.overhaulplan_delete(opgids)
     opsreq = overhaulplan_public.overhaulplan_select(opgid)
     if opgid not in opsreq:
         assert 1 == 1
     else:
         assert 1 == 2
 def test_overhaulplan_senddown_simple(self):
     u'''发布单条大修计划'''
     opgids = []
     opgid = overhaulplan_public.overhaulplan_create()
     opgids.append(opgid)
     equipmentmanage_public.associationequipment(opgid)
     overhaulplan_public.overhaulplan_senddown(opgids)
     opsreq = overhaulplan_public.overhaulplan_select(opgid)
     if 'status":"20' in opsreq:
         assert 1 == 1
     else:
         assert 1 == 2
예제 #5
0
def overhaulbill_create():
    u'''生成大修单'''
    opgids = []
    opgid = overhaulplan_public.overhaulplan_create()
    opgids.append(opgid)
    opsreq = overhaulplan_public.overhaulplan_select(opgid)
    opcode = json.loads(opsreq)['data']['code']
    equipmentmanage_public.associationequipment(opgid)
    overhaulplan_public.overhaulplan_senddown(opgids)
    obfreq = overhaulbill_findbycode(opcode)
    obgid = json.loads(obfreq)['data'][0]['gid']
    return obgid
 def test_overhaulplan_delete_more(self):
     u'''批量删除大修计划'''
     opgids = []
     for c in range(3):
         opgid = overhaulplan_public.overhaulplan_create()
         opgids.append(opgid)
     overhaulplan_public.overhaulplan_delete(opgids)
     check = 0
     for opgid in opgids:
         opsreq = overhaulplan_public.overhaulplan_select(opgid)
         if opgid not in opsreq:
             check = check + 0
         else:
             check = check + 1
     if check == 0:
         assert 1 == 1
     else:
         assert 1 == 2
 def test_overhaulplan_senddown_more(self):
     u'''批量发布大修计划'''
     opgids = []
     for c in range(3):
         opgid = overhaulplan_public.overhaulplan_create()
         opgids.append(opgid)
     for opgid in opgids:
         equipmentmanage_public.associationequipment(opgid)
     overhaulplan_public.overhaulplan_senddown(opgids)
     check = 0
     for opgid in opgids:
         opsreq = overhaulplan_public.overhaulplan_select(opgid)
         if 'status":"20' in opsreq:
             check = check + 0
         else:
             check = check + 1
     if check == 0:
         assert 1 == 1
     else:
         assert 1 == 2