Esempio n. 1
0
# coding=utf-8
import unittest
from common.tools import init_environment_213
from common.names import names
from common._mytest import MyTestTwoUser
from common._mytest import assert_one
from common.params import *
from common.logger import logger
from common._mytest import query_account_position_get
from common._mytest import assert_list
import time
from common.jsonparser import JMESPathExtractor
from common._mytest import market_info_get
import ddt

base, mysql_type, redis_type, sda_id = init_environment_213()

sda_order_create_url = names.sda_order_create_url
sda_order_get_open_url = names.sda_order_get_open_url
sda_order_cancel_url = names.sda_order_cancel_url

sda_get_url = names.sda_get_url
sda_account_asset_detail_get_url = names.sda_account_asset_detail_get_url
sda_account_positions_get_url = names.sda_account_positions_get_url

多单 = names.多单
空单 = names.空单
平多 = names.平多
平空 = names.平空
限价 = names.xianjiadan
市价 = names.shijiadan
Esempio n. 2
0
__author__ = '123'
# coding=utf-8
import requests
from common._mytest import MytestOnePlayer
from common.connectRedis import ConnectRedis
from common.connectMysql import ConnectMysql
from common.tools import init_environment_213
from common.tools import init_environment_253
from common._mytest import make_money

base, mysql_type, redis_type, sda_id = init_environment_253()
base_50, mysql_type_50, redis_type_50, sda_id_50 = init_environment_213()


def clear_all_data(sda_id, user_mail, user_id):
    """
    清除用户的合约下所有的mysql和redis数据
    :param sda_id: 合约ID
    :param user_id: 用户ID
    :return:
    """
    ConnectMysql(_type=mysql_type).sda_delete_user_order(sda_id=sda_id)
    ConnectRedis(_type=redis_type).sda_clear_order(sda_id=sda_id)
    ConnectRedis(_type=redis_type,
                 db=4).sda_clear_user_balance(user_id=user_id, keys=sda_id)
    ConnectMysql(_type=mysql_type).sda_clear_balance_value(user_id=user_id,
                                                           sda_id=sda_id)
    # ConnectMysql(_type=mysql_type).update_balance_value(user_mail=user_mail, currency_id=2, balance_value=90000000000000000)


# 51、52、53、54