예제 #1
0
# coding=gbk
"""
@Version: 1.0
@Project: Refreshtoken
@Author: long
@Data: 2018/7/19
@File: Refreshtoken.py
@Description: 获取特定币体检详情
"""
from unittest import TestCase
import requests
from common.logger import logfile
from get_config import GetConfig

cfg = GetConfig()
url_base = cfg.get_value("Urls", "Base_Url")
login_api = cfg.get_value("Urls", "Login")
api = cfg.get_value("Urls", "refreshtoken")
# mylog = logfile("Refreshtoken.log", type=0)
mobile = cfg.get_value("Login", "Mobile")
valid = cfg.get_value("Login", "Valid")


class Refreshtoken(TestCase):
    """刷新用户的token和过期时间"""

    def setUp(self):
        '执行预置条件'
        pass

    def tearDown(self):
@Version: 1.0
@Project: Message
@Author: long
@Data: 2018/7/19
@File: messasge_test.py
@Description: 获取新闻列表
"""

from unittest import TestCase
import requests
from common.logger import logfile
from get_config import GetConfig
import time

cfg = GetConfig()
url_base = cfg.get_value("Urls", "Base_Url")
api = cfg.get_value("Urls", "Message")
# mylog=logfile("Message.log",type=0)


class LapMessage(TestCase):
    """获取新闻列表"""
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def check(self, token, lau, ts, size):
        '执行新闻列表接口获取最新的N条(默认50)'
        url = url_base + api.format(token, lau, ts, size)
예제 #3
0
"""
@Version: 1.0
@Project: Get_Token_All
@Author: long
@Data: 2018/7/19
@File: Get_Token_All.py
@Description: 获取token列表接口
"""
from unittest import TestCase
import requests
from common.logger import logfile
from get_config import GetConfig

cfg = GetConfig()
url_base = cfg.get_value("Urls", "Base_Url")
api = cfg.get_value("Urls", "Get_Token_All")
# mylog = logfile("Get_Token_All.log", type=0)


class GetAllToken(TestCase):
    """获取token列表"""
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_get(self):
        """执行获取token列表接口"""
        url = url_base + api
        try:
예제 #4
0
@Version: 1.0
@Project: telegram
@Author: long
@Data: 2018/7/20
@File: telegram_test.py
@Description: 获取telegram列表
"""

from unittest import TestCase
import requests
from common.logger import logfile
from get_config import GetConfig
import time

cfg = GetConfig()
url_base = cfg.get_value("Urls", "Base_Url")
api = cfg.get_value("Urls", "Telegram")
# mylog=logfile("Telegram.log",type=0)


class LapTelegram(TestCase):
    """获取telegram列表"""
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def check(self, token, lau, ts, size):
        '执行telegram列表接口获取最新的N条(默认50)'
        url = url_base + api.format(token, lau, ts, size)
# coding=gbk
"""
@Version: 1.0
@Project: Token_Grade_One
@Author: long
@Data: 2018/7/19
@File: Token_Grade_One.py
@Description: 获取推荐币体检详情
"""
from unittest import TestCase
import requests
from common.logger import logfile
from get_config import GetConfig

cfg = GetConfig()
url_base = cfg.get_value("Urls", "Base_Url")
api = cfg.get_value("Urls", "Token_Grade")
# mylog = logfile("Token_Grade_One.log", type=0)


class TokenGradeThree(TestCase):
    """获取3个优质币"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_get(self):
        """执行获取3个优质币接口"""
예제 #6
0
"""
@Version: 1.0
@Project: Symbol_Flow
@Author: long
@Data: 2018/7/19
@File: Symbol_Flow.py
@Description: 交易对资金流向接口
"""
from unittest import TestCase
import requests
from common.logger import logfile
from get_config import GetConfig
import time
cfg = GetConfig()
url_base = cfg.get_value("Urls", "Base_Url")
api = cfg.get_value("Urls", "Symbol_Flow")
# mylog = logfile("Symbol_Flow.log", type=0)


class GetSymbolFlow(TestCase):
    """交易对资金流向接口"""
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def check(self, market, symbol, cycle, ts):
        url = url_base + api.format(market, symbol, cycle, ts)
        try:
            rep = requests.get(url, timeout=10).json()
#coding=gbk
"""
@Version: 1.0
@Project: Version
@Author: long
@Data: 2018/7/19
@File: Version.py
@Description: 获取版本信息
"""
from unittest import TestCase
import requests
from common.logger import logfile
from get_config import GetConfig

cfg = GetConfig()
url_base = cfg.get_value("Urls", "Base_Url")
api = cfg.get_value("Urls", "Version")
# mylog=logfile("Version.log",type=0)


class LapVersion(TestCase):
    """获取版本信息"""
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_get(self):
        """获取版本信息"""
        url = url_base + api
@Version: 1.0
@Project: twitter
@Author: long
@Data: 2018/7/20
@File: twitter_test.py
@Description: 获取twitter列表
"""

from unittest import TestCase
import requests
from common.logger import logfile
from get_config import GetConfig
import time

cfg = GetConfig()
url_base = cfg.get_value("Urls", "Base_Url")
api = cfg.get_value("Urls", "Twitter")
# mylog=logfile("twitter.log",type=0)


class LapTwitter(TestCase):
    "获取twitter列表"

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def check(self, token, lau, ts, size):
        '执行twitter列表接口获取最新的N条(默认50)'