def __init__(self):
     global log
     log = Pylog().log_formatter()
Exemple #2
0
    def test_搜索站内信(self):
        Pylog.info("【内容管理-站内信管理-站内信-搜索站内信】")
        resp = self.content.instationMsg_list()
        dictResp = json.loads(resp)
        totalSize = dictResp['data']['totalSize']
        self.assertGreater(totalSize, 0)

    def test_发送站内信(self):
        Pylog.info("【内容管理-站内信管理-站内信-发送站内信】")
        resp = self.content.instationMsg_save()
        dictResp = json.loads(resp)
        data = dictResp['data']
        self.assertGreater(data, 0)

    def test_公告通知(self):
        Pylog.info("【内容管理-公告通知】")
        resp = self.content.bulletin_list()
        dictResp = json.loads(resp)
        err = dictResp['err']
        self.assertEqual("SUCCESS", err)


if __name__ == "__main__":
    Pylog()
    testsuite = unittest.makeSuite(Ownercase)
    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(testsuite)

    # Ownercase().test_今日方案()
# -*- coding: UTF-8 -*-
from pylog import Pylog

logging = Pylog()
import HTMLTestRunner
import unittest
import time
import sys
import os
import config
from casesuite import Case

# runmode = config.get_config("mode","mode")
# switch = {
#     "normol": Case
# }

suite = unittest.TestLoader().loadTestsFromTestCase(Case)
filename = sys.path[0] + "./Report/report.html"
fp = open(filename, "wb")
runner = HTMLTestRunner.HTMLTestRunner(stream=fp,
                                       title=u"测试报告",
                                       description=u"用例测试情况")
runner.run(suite)
fp.close()