コード例 #1
0
ファイル: test_66.py プロジェクト: xiaoxiangLiu/test
class TestCase(unittest.TestCase):

    """
    做市商老接口
    """
    user_buyer_mail = GetInit().GetData("user", "user_buyer_mail")
    user_password = GetInit().GetData("user", "user_password")
    base_url = GetInit().GetData("base", "50_base_url")

    def setUp(self):
        headers = {
            "Accept-Encoding": "gzip",
            "User-Agent": "android-6.0/Meizu(M5)",
        }
        url = self.base_url + "/userLogin.do"
        token_param = {
            "isAuto": "",
            "userMail": self.user_buyer_mail,
            "platform": "Android",
            "timeStamp": "1538118050702",
            "token": "",
            "languageType": 3,
            "userPassword": self.user_password,
            "uuid": "00000000-7508-8fb8-d616-f1c80033c587",
            "version": "1.2.1",
        }
        token = get_token(path="gin", **token_param)
        param = {
            "isAuto": "",
            "userMail": self.user_buyer_mail,
            "platform": "Android",
            "timeStamp": "1538118050702",
            "token": token,
            "languageType": 3,
            "userPassword": self.user_password,
            "uuid": "00000000-7508-8fb8-d616-f1c80033c587",
            "version": "1.2.1",
        }
        self.url = self.base_url + "/orderbuyerrest.do"
        self.requ = requests.session()
        self.resp = self.requ.post(url=url, headers = headers, data=param)

    def tearDown(self):
        self.requ.close()

    def test_01(self):
        """
        做市商下买单
        """
        data = {
            "userMail": "*****@*****.**",
            "buyerOrderNum": 1000000000,
            "buyerOrderPrice": 200,
            "transtionId": transtion_id,
            "orderType": 0,
            "userPass": "******"
        }
        self.resp_2 = self.requ.post(url=self.url, data=data)
        print(self.resp_2.status_code)
        self.assertEqual(self.resp_2.json()["MSG"], "SUCCESS")
コード例 #2
0
ファイル: test_58.py プロジェクト: xiaoxiangLiu/test
from common.connectRedis import ConnectRedis
from common.connectMysql import ConnectMysql
from common.logger import logger
from common.myTest import MyTest
from common.config import GetInit
import ddt
from common.tools import get_redis_name
from common.names import names
from common.tools import init_environment
from common.jsonparser import JMESPathExtractor
import time
base_url, mysql_type, redis_type = init_environment()

BUYER = names.market_user_38
SELLER = names.user_39
transtion_4 = GetInit().get_test_data(file_name="transtion_4_half.yaml")
transtion_11 = GetInit().get_test_data(file_name="transtion_11_half.yaml")
transtion_12 = GetInit().get_test_data(file_name="transtion_12_half.yaml")
transtion_10 = GetInit().get_test_data(file_name="transtion_10_half.yaml")
transtion_24 = GetInit().get_test_data(file_name="transtion_24_half.yaml")
transtion_25 = GetInit().get_test_data(file_name="transtion_25_half.yaml")
transtion_37 = GetInit().get_test_data(file_name="transtion_37_half.yaml")
# transtion_35 = GetInit().get_test_data(file_name="transtion_35_half.yaml")
transtion_36 = GetInit().get_test_data(file_name="transtion_36_half.yaml")
# transtion_33 = GetInit().get_test_data(file_name="transtion_33_half.yaml")
transtion_34 = GetInit().get_test_data(file_name="transtion_34_half.yaml")
# transtion_31 = GetInit().get_test_data(file_name="transtion_31_half.yaml")
transtion_32 = GetInit().get_test_data(file_name="transtion_32_half.yaml")
transtion_29 = GetInit().get_test_data(file_name="transtion_29_half.yaml")
transtion_30 = GetInit().get_test_data(file_name="transtion_30_half.yaml")
transtion_44 = GetInit().get_test_data(file_name="transtion_44_half.yaml")
コード例 #3
0
from common.connectMysql import ConnectMysql
from common.logger import logger
from common.myTest import MyTest
from common.config import GetInit
import ddt
from common.tools import get_redis_name

from common.names import names
from common.tools import init_environment
from common.jsonparser import JMESPathExtractor
import time
base_url, mysql_type, redis_type = init_environment()

BUYER = names.market_user_38
SELLER = names.market_user_40
transtion_4 = GetInit().get_test_data(file_name="transtion_4.yaml")
transtion_11 = GetInit().get_test_data(file_name="transtion_11.yaml")
transtion_12 = GetInit().get_test_data(file_name="transtion_12.yaml")
transtion_10 = GetInit().get_test_data(file_name="transtion_10.yaml")
transtion_24 = GetInit().get_test_data(file_name="transtion_24.yaml")
transtion_25 = GetInit().get_test_data(file_name="transtion_25.yaml")
transtion_37 = GetInit().get_test_data(file_name="transtion_37.yaml")
# transtion_35 = GetInit().get_test_data(file_name="transtion_35.yaml")
transtion_36 = GetInit().get_test_data(file_name="transtion_36.yaml")
# transtion_33 = GetInit().get_test_data(file_name="transtion_33.yaml")
transtion_34 = GetInit().get_test_data(file_name="transtion_34.yaml")
# transtion_31 = GetInit().get_test_data(file_name="transtion_31.yaml")
transtion_32 = GetInit().get_test_data(file_name="transtion_32.yaml")
transtion_29 = GetInit().get_test_data(file_name="transtion_29.yaml")
transtion_30 = GetInit().get_test_data(file_name="transtion_30.yaml")
transtion_44 = GetInit().get_test_data(file_name="transtion_44.yaml")
コード例 #4
0
__author__ = '123'
# coding=utf-8
from common.run import query_user_balance_value
from common.base import Base
from common.myTest import MyTest
from common.logger import logger
from common.connectMysql import ConnectMysql
from common.connectRedis import ConnectRedis
from common.config import GetInit
from common.tools import get_redis_name
from common.count import count_value_sell_first
from common.count import count_value_buy_first
import time, unittest
from common.tools import init_environment

test_data = GetInit().get_test_data(file_name="test_30.yaml")
base_test_data = GetInit().get_test_data(file_name="base.yaml")

base_url, mysql_type, redis_type = init_environment()
buy_price = test_data.get("buy_price")
buy_num = test_data.get("buy_num")
progre_buy_price = test_data.get("progre_buy_price")
progre_buy_num = test_data.get("progre_buy_num")
end_buy_price = test_data.get("end_buy_price")
end_buy_num = test_data.get("end_buy_num")
sell_price = test_data.get("sell_price")
sell_num = test_data.get("sell_num")
progre_sell_price = test_data.get("progre_sell_price")
progre_sell_num = test_data.get("progre_sell_num")
end_sell_price = test_data.get("end_sell_price")
end_sell_num = test_data.get("end_sell_num")
コード例 #5
0
ファイル: test_70.py プロジェクト: xiaoxiangLiu/test
class TestCase(unittest.TestCase):

    """
    做市商老接口
    """
    user_buyer_mail = GetInit().GetData("user", "user_buyer_mail")
    user_password = GetInit().GetData("user", "user_password")
    base_url = GetInit().GetData("base", "50_base_url")

    def setUp(self):
        headers = {
            "Accept-Encoding": "gzip",
            "User-Agent": "android-6.0/Meizu(M5)",
        }
        url = self.base_url + "/userLogin.do"
        token_param = {
            "isAuto": "",
            "userMail": self.user_buyer_mail,
            "platform": "Android",
            "timeStamp": "1538118050702",
            "token": "",
            "languageType": 3,
            "userPassword": self.user_password,
            "uuid": "00000000-7508-8fb8-d616-f1c80033c587",
            "version": "1.2.1",
        }
        token = get_token(path="gin", **token_param)
        param = {
            "isAuto": "",
            "userMail": self.user_buyer_mail,
            "platform": "Android",
            "timeStamp": "1538118050702",
            "token": token,
            "languageType": 3,
            "userPassword": self.user_password,
            "uuid": "00000000-7508-8fb8-d616-f1c80033c587",
            "version": "1.2.1",
        }
        self.url = self.base_url + "/queryorderrest.do"
        self.requ = requests.session()
        self.resp = self.requ.post(url=url, headers = headers, data=param)

    def tearDown(self):
        self.requ.close()

    def test_01(self):
        """
        做市商根据订单ID查询订单
        """
        self.sell_url = self.base_url + "/ordersellerrest.do"
        sell_data = {
            "sellerOrderNum": 10000000,
            "sellerOrderPrice": 500000,
            "languageType": 3,
            "timeStamp": "1538118050702",
            "transtionId": transtion_id,
            "userMail": "*****@*****.**",
            "userPass": "******"
        }
        self.sell_resp = self.requ.post(url=self.sell_url, data = sell_data)
        print(self.sell_resp.status_code)
        order_id = JMESPathExtractor().extract(query="OBJECT.sellerOrderId", body=self.sell_resp.text)
        print(order_id)
        time.sleep(4)
        data = {
            "userMail": "*****@*****.**",
            "userPass": "******",
            "orderId": order_id,
            "type": "2"
        }
        self.resp_3 = self.requ.post(url=self.url, data = data)
        print(self.resp_3.status_code)
        self.assertEqual(self.resp_3.json()["MSG"], "SUCCESS")
        print("接口返回信息:", self.resp_3.json())
コード例 #6
0
ファイル: test_40.py プロジェクト: xiaoxiangLiu/test
__author__ = '123'
# coding=utf-8
from common.jsonparser import JMESPathExtractor
from common.run import query_user_balance_value
from common.base import Base
from common.logger import logger
from common.myTest import MyTest
from common.connectRedis import ConnectRedis
from common.connectMysql import ConnectMysql
from common.config import GetInit
from common.tools import count_balance
from common.tools import get_redis_name
import time

test_data = GetInit().get_test_data(file_name="test_40.yaml")
base_test_data = GetInit().get_test_data(file_name="base.yaml")
mysql_type = base_test_data.get("50_mysql_type")
redis_type = base_test_data.get("50_redis_type")

sell_price = 2000000000
buy_price = 1000000000
sell_num = 3000000000
buy_num = 1000000000

transtion_id = 10
main_currency_id = 5
target_currency_id = 2

BUYER = base_test_data.get("market_user_38")
SELLER = base_test_data.get("market_user_40")