def test_cpLackMaterialSub_leadin_edit(self, cgsqclear, c1, expect):
     s = cgsqclear
     self.log.info("采购申请编辑与清空")
     r = SRMBase(s)
     leadin = r.cpLackMaterialSub_leadin("c:/cpLackMaterialSub_leadin.xlsx")
     self.log.info("导入结果是%s" % leadin.json())
     data = r.cpLackMaterialSub_leadin_page("column12", "自动化导入")
     self.log.info("查询结果是{}".format(data.json()))
     lid = jsonpath.jsonpath(data.json(), '$..id')[0]
     self.log.info("抓取到lid是%s" % lid)
     r.cpLackMaterialSub_leadin_edit(lid, c1)
     msg = r.cpLackMaterialSub_leadin_page("column12", "自动化导入")
     msg_id = jsonpath.jsonpath(msg.json(), '$..column1')[0]
     assert msg_id == expect
 def test_cpLackMaterialSub_leadin(self, gettokenfixture, file):
     s = gettokenfixture
     self.log.info("---采购申请导入---")
     r = SRMBase(s)
     count = r.cpLackMaterialSub_count("createBy", "zhongzijian")
     ass = count.json()["data"]["total"]
     msg = r.cpLackMaterialSub_leadin(file)
     self.log.info("导入结果是%s" % msg.json())
     r.cpLackMaterialSub_leadin_commit()
     count2 = r.cpLackMaterialSub_count("createBy", "zhongzijian")
     ass2 = count2.json()["data"]["total"]
     if file == "c:/cpLackMaterialSub_leadin.xlsx":
         assert ass2 - 1 == ass
     else:
         assert ass2 == ass