示例#1
0
 def setUp(self):
     self.cookie = mylogin()
     goodsDetail = GoodsDetail.test_goodsDetail(self)
     self.goodsId = goodsDetail['result']['goodsDetail']['goodsId']
     goodsSkus = goodsDetail["result"]["goodsSkus"]
     skuIds = [goodsSku['skuId'] for goodsSku in goodsSkus]
     self.skuId = skuIds[0]
示例#2
0
def readexcel_data():

    list = []
    a = 0
    # f = open('a.txt', 'r')
    for line in open('a.txt'):
        # line = f.readline()
        userInfo = mylogin(line.strip())
        # print(userInfo)
        i = 0
        while True:
            id = 259740230000016
            data1 = {'id':id}
            response1 = requests.post(url="http://123.157.216.154:8000/sdapp/goods/hot/saveLoveNum",data=data1,cookies=userInfo)
            code = response1.status_code
            if code == 200:
                i += 1
                result1 = json.loads(response1.content)
                # print(result1)
                if result1["result"]["hasPrize"] == True:
                    print(i)
                    # list.append(i)
                    break
    for a1 in list:
        a += a1
    print(str((a / len(list))*100) + '%')
示例#3
0
 def setUp(self):
     self.cookie = mylogin()
示例#4
0
 def setUp(self):
     self.cookie = mylogin()
     dict = goodsDetail.GoodsDetail.test_a_goodsDetail(self)
     self.skuId = dict["skuId"]