def test_updateSkuImg3(self):
     '''token正确,product_id错误'''
     r = SendRequest.sendRequest(s, updateSkuImg_data[2])
     expect_result = updateSkuImg_data[2]['expect_result'].split(":",1)[1]
     msg = updateSkuImg_data[2]['msg'].split(":",1)[1]
     self.assertEqual(r.json()['execute_status'], eval(expect_result),msg=r.json())
     self.assertEqual(r.json()['data']['code'] ,eval(msg),msg=r.json())
    def test_deleteGoods5(self):
        '''商品id错误,token正确'''
        r=SendRequest.sendRequest(s,deleteGoods_data[4])
        expect_result = deleteGoods_data[4]['expect_result'].split(":",1)[1]
        msg = deleteGoods_data[4]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'], eval(expect_result), msg=r.json())
        self.assertEqual(r.json()['message'], eval(msg), msg=r.json())
    def test_updateSkuImg4(self):
        '''token正确,goods_sku错误'''
        r = SendRequest.sendRequest(s, updateSkuImg_data[3])
        expect_result = updateSkuImg_data[3]['expect_result'].split(":",1)[1]
        msg = updateSkuImg_data[3]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'], eval(expect_result),msg=r.json())
        self.assertEqual(r.json()['data']['errors_list'][0]['code'] ,eval(msg),msg=r.json())
Exemple #4
0
    def test_disableSale4(self):
        '''无海外仓直接下架:商品id错误'''
        r=SendRequest.sendRequest(s,disableSale_data[3])
        expect_result=disableSale_data[3]['expect_result'].split(":",1)[1]
        msg=disableSale_data[3]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'],eval(expect_result),msg=r.json())
        self.assertEqual(r.json()['data']['errors_list'][0]['code'], eval(msg),msg=r.json())
Exemple #5
0
    def test_getGroupProductId4(self):
        '''商品id错误,token正确'''
        r=SendRequest.sendRequest(s,getGroupProductId_data[3])
        expect_result=getGroupProductId_data[3]['expect_result'].split(":",1)[1]
        msg=getGroupProductId_data[3]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'],eval(expect_result),msg=r.json())
        self.assertEqual(r.json()['message'],eval(msg),msg=r.json())
Exemple #6
0
    def test_getGroupProductId1(self):
        '''商品id正确,token正确'''
        r=SendRequest.sendRequest(s,getGroupProductId_data[0])
        expect_result=getGroupProductId_data[0]['expect_result'].split(":",1)[1]
        msg=getGroupProductId_data[0]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'],eval(expect_result),msg=r.json())
        self.assertEqual(r.json()['data'][0]['goods_id'],eval(msg),msg=r.json())
Exemple #7
0
    def test_disableSale3(self):
        '''无海外仓直接下架:token和商品id都正确'''
        r=SendRequest.sendRequest(s,disableSale_data[2])
        expect_result=disableSale_data[2]['expect_result'].split(":",1)[1]
        msg=disableSale_data[2]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'],eval(expect_result),msg=r.json())
        self.assertEqual(r.json()['data']['code'],eval(msg),msg=r.json())
Exemple #8
0
    def test_disableSale2(self):
        '''有海外仓库存:清零标准仓库存不下架'''
        r=SendRequest.sendRequest(s,disableSale_data[1])
        expect_result=disableSale_data[1]['expect_result'].split(":",1)[1]
        msg=disableSale_data[1]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'],eval(expect_result),msg=r.json())
        self.assertEqual(r.json()['data']['code'],eval(msg),msg=r.json())
    def test_updateGoodsByType6(self):
        '''参数错误'''
        r=SendRequest.sendRequest(s,updateGoodsByType_data[5])
        expect_result = updateGoodsByType_data[5]['expect_result'].split(":",1)[1]
        msg = updateGoodsByType_data[5]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'], eval(expect_result), msg=r.json())
        self.assertEqual(r.json()['message'], eval(msg), msg=r.json())
Exemple #10
0
 def test_getUploadGoodsStatus3(self):
     '''token正确,批次id错误'''
     r = SendRequest.sendRequest(s, getUploadGoodsStatus_data[2])
     expect_result = getUploadGoodsStatus_data[2]['expect_result'].split(
         ":", 1)[1]
     msg = getUploadGoodsStatus_data[2]['msg'].split(":", 1)[1]
     self.assertEqual(r.json()['code'], eval(expect_result))
     self.assertEqual(r.json()['message'], eval(msg))
 def test_addProductSku1(self):
     '''token及参数都正确'''
     r = SendRequest.sendRequest(s, addProductSku_data[0])
     expect_result = addProductSku_data[0]['expect_result'].split(":", 1)[1]
     msg = addProductSku_data[0]['msg'].split(":", 1)[1]
     self.assertEqual(r.json()['execute_status'],
                      eval(expect_result),
                      msg=r.json())
     self.assertEqual(r.json()['data']['message'], eval(msg), msg=r.json())
 def test_addProductSku2(self):
     '''新增sku参数重复'''
     r = SendRequest.sendRequest(s, addProductSku_data[0])
     expect_result = addProductSku_data[1]['expect_result'].split(":", 1)[1]
     msg = addProductSku_data[1]['msg'].split(":", 1)[1]
     self.assertEqual(r.json()['execute_status'],
                      eval(expect_result),
                      msg=r.json())
     self.assertEqual(r.json()['data']['code'], eval(msg), msg=r.json())
    def test_ableSale1(self):
        '''token和商品id都正确'''

        r=SendRequest.sendRequest(s,ableSale_data[0])
        expect_result=ableSale_data[0]['expect_result'].split(":",1)[1]
        msg=ableSale_data[0]['msg'].split(":",1)[1]

        self.assertEqual(r.json()['execute_status'],eval(expect_result),msg=r.json())
        self.assertEqual(r.json()['data']['code'],eval(msg),msg=r.json())
 def test_ableSale2(self):
     '''商品id错误'''
     #现接口返回错误,等开发修改
     r=SendRequest.sendRequest(s,ableSale_data[1])
     expect_result=ableSale_data[1]['expect_result'].split(":",1)[1]
     msg=ableSale_data[1]['msg'].split(":",1)[1]
     print(r.json())
     self.assertEqual(r.json()['execute_status'],eval(expect_result),msg=r.json())
     self.assertEqual(r.json()['data']['errors_list'][0]['code'], eval(msg),msg=r.json())
Exemple #15
0
 def test_getProductImgInfo3(self):
     '''商品id为空或错误'''
     r = SendRequest.sendRequest(s, getProductImgInfo_data[2])
     expect_result = getProductImgInfo_data[2]['expect_result'].split(
         ":", 1)[1]
     msg = getProductImgInfo_data[2]['msg'].split(":", 1)[1]
     self.assertEqual(r.json()['product_id'],
                      eval(expect_result),
                      msg=r.json())
     self.assertEqual(r.json()['message'], eval(msg), msg=r.json())
 def test_uploadSizeChart4(self):
     '''token正确,product_id错误'''
     r = SendRequest.sendRequest(s, uploadSizeChart_data[3])
     expect_result = uploadSizeChart_data[3]['expect_result'].split(":",
                                                                    1)[1]
     msg = uploadSizeChart_data[3]['msg'].split(":", 1)[1]
     self.assertEqual(r.json()['execute_status'],
                      eval(expect_result),
                      msg=r.json())
     self.assertEqual(r.json()['message'], eval(msg), msg=r.json())
Exemple #17
0
 def test_updateRegionShippingFee3(self):
     '''token正确,运费参数不正确'''
     r = SendRequest.sendRequest(s, updateRegionShippingFee_data[2])
     expect_result = updateRegionShippingFee_data[2]['expect_result'].split(
         ":", 1)[1]
     msg = updateRegionShippingFee_data[2]['msg'].split(":", 1)[1]
     self.assertEqual(r.json()['execute_status'],
                      eval(expect_result),
                      msg=r.json())
     self.assertEqual(r.json()['message'], eval(msg), msg=r.json())
Exemple #18
0
    def test_getCatAttr3(self):
        '''分类id错误,token正确'''
        r = SendRequest.sendRequest(s, getCatAttr_data[2])
        expect_result = getCatAttr_data[2]['expect_result'].split(":", 1)[1]
        msg = getCatAttr_data[2]['msg'].split(":", 1)[1]

        self.assertEqual(r.json()['execute_status'],
                         eval(expect_result),
                         msg=r.json())
        self.assertEqual(r.json()['message'], eval(msg), msg=r.json())
    def test_updateGoodsByType1(self):
        '''修改商品名称'''

        r=SendRequest.sendRequest(s,updateGoodsByType_data[0])
        expect_result = updateGoodsByType_data[0]['expect_result'].split(":",1)[1]
        msg = updateGoodsByType_data[0]['msg'].split(":",1)[1]
        print(r.json())
        print(updateGoodsByType_data)

        self.assertEqual(r.json()['execute_status'], eval(expect_result), msg=r.json())
        self.assertEqual(r.json()['message'], eval(msg), msg=r.json())
 def test_addProductSku3(self):
     '''token正确,参数为空'''
     r = SendRequest.sendRequest(s, addProductSku_data[2])
     expect_result = addProductSku_data[2]['expect_result'].split(":", 1)[1]
     msg = addProductSku_data[2]['msg'].split(
         ":", 1)[1] + ':' + addProductSku_data[2]['msg'].split(":")[2]
     self.assertEqual(r.json()['execute_status'],
                      eval(expect_result),
                      msg=r.json())
     self.assertEqual(r.json()['data']['errors_list'][0]['message'],
                      eval(msg),
                      msg=r.json())
Exemple #21
0
 def test_getUploadGoodsStatus1(self):
     '''token和批次id都正确'''
     r = SendRequest.sendRequest(s, getUploadGoodsStatus_data[0])
     expect_result1 = getUploadGoodsStatus_data[0]['expect_result'].split(
         ":")[1]
     expect_result2 = getUploadGoodsStatus_data[0]['expect_result'].split(
         ":")[2]
     if r.json()['code'] == 'loading':
         self.assertEqual(r.json()['code'],
                          eval(expect_result1),
                          msg=r.json())
     else:
         self.assertEqual(r.json()['code'],
                          eval(expect_result2),
                          msg=r.json())
    def test_ableSale3(self):
        '''token错误'''
        r=SendRequest.sendRequest(s,ableSale_data[2])
        expect_result=ableSale_data[2]['expect_result'].split(":",1)[1]

        self.assertEqual(r.json(), eval(expect_result),msg=r.json())
Exemple #23
0
    def test_getGroupProductId2(self):
        '''商品id正确,token错误'''
        r=SendRequest.sendRequest(s,getGroupProductId_data[1])
        expect_result=getGroupProductId_data[1]['expect_result'].split(":",1)[1]

        self.assertEqual(r.json(),eval(expect_result),msg=r.json())
Exemple #24
0
 def test_getProductImgInfo2(self):
     '''token不正确'''
     r = SendRequest.sendRequest(s, getProductImgInfo_data[1])
     expect_result = getProductImgInfo_data[1]['expect_result'].split(
         ":", 1)[1]
     self.assertEqual(r.json(), eval(expect_result), msg=r.json())
 def test_addProductSku4(self):
     '''token不正确,其余参数都正确'''
     r = SendRequest.sendRequest(s, addProductSku_data[3])
     expect_result = addProductSku_data[3]['expect_result'].split(":", 1)[1]
     self.assertEqual(r.json(), eval(expect_result), msg=r.json())
    def test_updateSkuImg2(self):
        '''token错误,其余参数正确'''
        r = SendRequest.sendRequest(s, updateSkuImg_data[1])
        expect_result = updateSkuImg_data[1]['expect_result'].split(":",1)[1]

        self.assertEqual(r.json(), eval(expect_result),msg=r.json())
Exemple #27
0
 def test_updateRegionShippingFee2(self):
     '''token错误,运费参数正确'''
     r = SendRequest.sendRequest(s, updateRegionShippingFee_data[1])
     expect_result = updateRegionShippingFee_data[1]['expect_result'].split(
         ":", 1)[1]
     self.assertEqual(r.json(), eval(expect_result), msg=r.json())
Exemple #28
0
    def test_getCatAttr4(self):
        '''分类id正确,token错误'''
        r = SendRequest.sendRequest(s, getCatAttr_data[3])
        expect_result = getCatAttr_data[3]['expect_result'].split(":", 1)[1]

        self.assertEqual(r.json(), eval(expect_result), msg=r.json())
    def test_deleteGoods4(self):
        '''商品id正确,token错误'''
        r=SendRequest.sendRequest(s,deleteGoods_data[3])
        expect_result = deleteGoods_data[3]['expect_result'].split(":",1)[1]

        self.assertEqual(r.json(), eval(expect_result), msg=r.json())
    def test_updateGoodsByType7(self):
        '''token错误'''
        r=SendRequest.sendRequest(s,updateGoodsByType_data[6])
        expect_result = updateGoodsByType_data[6]['expect_result']

        self.assertEqual(r.json(), eval(expect_result), msg=r.json())