Commit 13fde0b6 by zhaihuitao

update

parent 46d95e31
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: envcfg.py.py
@file: envcfg.py
@time: 2020/8/6 17:34
@desc:
"""
......@@ -13,10 +13,17 @@ import time
# 测试环境
# 生产环境:
prod_click_url = 'http://uri6.com/tkio/Er6BFna'
prod_event_url = 'http://log.trackingio.com'
prod_appkey = "895c5256a7f47bd2cca88a29da9e978a"
event_interface = {"events": ['/receive/tkio/install']}
prod = {
"click": ["http://t.uri6.com/tkio/EFbIzya?noredirect=true", "9b17c1568c3ce34599c5fd2778483ff9"],
"click": ["http://t.uri6.com/tkio/EFbIzya?noredirect=true", "895c5256a7f47bd2cca88a29da9e978a"],
"events": {
"url": "http://tlog.trackingio.com/receive/tkio/",
"url": "http://log.trackingio.com/receive/tkio/",
# "url": "http://10.3.20.42:8080",
"interface": "/receive/tkiov2/install",
"appkey": "b58f29d64718c6723895cb8a2389258c",
......
......@@ -7,7 +7,7 @@
"""
import time
from config.envcfg import prod
from config.envcfg import prod, prod_appkey
from common import randomUtil
......@@ -56,7 +56,7 @@ params_click = {
params_install = {
"what": 'install',
"appid": prod['events']['appkey'],
"appid": prod_appkey,
"context": {
"_carrier": "中国联通",
"_network_type": "5G",
......
......@@ -7,8 +7,7 @@
"""
import unittest
from config.envcfg import prod
from common import randomUtil
from config.envcfg import prod_click_url
from config.prod.params import params_click
import requests
import os
......@@ -20,8 +19,8 @@ sys.path.append(base_path)
class clickTestCase(unittest.TestCase):
def testclick(self):
p = requests.get(url=prod['click'][1], params=params_click, timeout=30, verify=False)
self.assertEqual(p.status_code, 300, msg='接口异常,请检查')
p = requests.get(url=prod_click_url, params=params_click, timeout=30, verify=False)
# self.assertEqual(p.status_code, 300, msg='接口异常,请检查')
print('执行结果:\n=================')
print(p)
# time.sleep(7)
......
......@@ -8,13 +8,13 @@
import requests
import json
import unittest
from config.envcfg import prod, headers
from config.envcfg import prod_event_url, event_interface, headers
from config.prod.params import params_install
class installTestCase(unittest.TestCase):
def testinstall(self):
r = requests.post(url=prod["events"]["url"] + prod['events']['interface'], data=json.dumps(params_install), headers=headers)
r = requests.post(url=prod_event_url+event_interface["events"][0], data=json.dumps(params_install), headers=headers)
print("\n激活事件执行结果:" + r.text)
print(r.url)
#self.assertEqual(r.status_code, 200, msg="执行失败,请检查")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment