@Data: 2018/7/12 @File: login_logout_test.py @Description: 检查是否可以登录退出 """ import random import os import time import unittest from common.log import MyLog from get_config import GetConfig from common.request_data import ConfigRequest config = GetConfig() base_url = config.get_url("Base_Url") log = MyLog.get_log() logger = log.get_logger() class LoginLogout(unittest.TestCase): def setUp(self): self.token = "" print("Test start") def tearDown(self): print("Test end") def test_login(self): """ 检查可以正确登录
@Data: 2018/7/18 @File: symbol_list_test.py @Description: 检查交易对列表数据 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('symbol_list') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class SymbolList(unittest.TestCase): """ 测试交易对列表接口 """ def setUp(self): logger.info('test "{}" start'.format(test_url)) def tearDown(self):
@Version: 1.0 @Project: Home Page @Author: Zhang Kaiming @Data: 2018/7/20 @Description: 检查获取所有token的接口 """ import random import os import unittest from common.log import MyLog from get_config import GetConfig from common.request_data import ConfigRequest config = GetConfig() all_token_api = config.get_url("Get_Token_All") log = MyLog.get_log() logger = log.get_logger() class GetAllToken(unittest.TestCase): "获取token列表" def setUp(self): pass def tearDown(self): pass def test_get(self):
@Data: 2018/7/18 @File: token_candle_test.py @Description: 检查K线数据 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('token_candle') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class TokenCandle(unittest.TestCase): """ 测试K线接口 """ def setUp(self): logger.info('test "{}" start'.format(test_url.format('Bitcoin', '1d'))) def tearDown(self):
@File: f10_intro_test.py @Description: 检查f10基本信息intro部分 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('f10_intro') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class F10Intro(unittest.TestCase): """ 测试f10基本信息接口 """ def setUp(self): logger.info('test "{}" start'.format(test_url.format('Bitcoin'))) def tearDown(self):
@Data: 2018/7/18 @File: message_news_test.py @Description: 检查新闻数据 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('message_news') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class MessageNews(unittest.TestCase): """ 测试新闻接口 """ def setUp(self): logger.info('test "{}" start'.format(test_url.format('Bitcoin'))) def tearDown(self):
@Data: 2018/7/18 @File: symbol_ranking_volume_test.py @Description: 检查交易对按volume排行数据 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('symbol_rank_volume') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class SymbolRankingVolume(unittest.TestCase): """ 测试交易对按volume接口 """ def setUp(self): logger.info('test "{}" start'.format(test_url)) def tearDown(self):
@Data: 2018/7/18 @File: f10_links_test.py @Description: 检查f10基本信息links部分 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('f10_links') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class F10Links(unittest.TestCase): """ 测试f10基本信息接口 """ def setUp(self): logger.info('test "{}" start'.format(test_url.format('Bitcoin'))) def tearDown(self):
@Data: 2018/7/18 @File: symbol_index_test.py @Description: 检查交易对首页头部指数数据 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('symbol_index') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class SymbolIndex(unittest.TestCase): """ 测试交易对首页接口 """ def setUp(self): logger.info('test "{}" start'.format(test_url)) def tearDown(self):
@Data: 2018/7/18 @File: symbol_ranking_abbr_test.py @Description: 检查单个币的交易对排行数据 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('symbol_rank_abbr') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class SymbolDetail(unittest.TestCase): """ 测试交易对详情接口 """ def setUp(self): logger.info('test "{}" start'.format(test_url.format('btc'))) def tearDown(self):
@Data: 2018/7/18 @File: symbol_detail_test.py @Description: 检查交易对详情数据 """ import os import random import unittest from common.log import MyLog from common.mongodb import BcfMongo from common.request_data import ConfigRequest from get_config import GetConfig config = GetConfig() base_url = config.get_url('Base_Url') test_url = config.get_url('symbol_detail') log = MyLog.get_log() logger = log.get_logger() logger.info('start run {}'.format(__file__)) class SymbolDetail(unittest.TestCase): """ 测试交易对详情接口 """ def setUp(self): logger.info('test "{}" start'.format( test_url.format('huobipro', 'btc-usdt')))
""" @Version: 1.0 @Project: @Author: Zhang Kaiming @Data: 2018/7/20 @Description: 检查新闻接口 """ import time, datetime import unittest from common.log import MyLog from get_config import GetConfig from common.request_data import ConfigRequest config = GetConfig() news_api = config.get_url("news") log = MyLog.get_log() logger = log.get_logger() class GetNews(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_get(self): """ 检查返回正确的token数据