Skip to content

Commit

Permalink
# 优化项目结构
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanoxl committed Jan 31, 2018
1 parent d4da8ff commit 93b9075
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 961 deletions.
6 changes: 3 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import click
import unittest
from BeautifulReport import BeautifulReport
from lib import CreateCases
from src.lib import CreateCases

CREATE_CASES_FILE_STATUS = CreateCases.CreateCase()


@click.command()
@click.option('--cases', default='testcases/', help="case file path")
@click.option('--cases', default='src/testcases/', help="case file path")
@click.option('--pattern', default='*.py', help="get cases file pattern")
@click.option('--report', default='report/', help="generator report in path")
@click.option('--report', default='src/report/', help="generator report in path")
def run(cases, pattern, report):
test_suite = unittest.defaultTestLoader.discover(cases, pattern=pattern)
result = BeautifulReport(test_suite)
Expand Down
8 changes: 8 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
@Version: 1.0
@Project: doraemon
@Author: Raymond
@Data: 2018/1/31 下午3:53
@File: __init__.py.py
@License: MIT
"""
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions config/config.py → src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"""
import json
import os
from lib.LogHandler import LogHandler
from lib import GetDictParam, CasesManager, CasesContainer
from ..lib.LogHandler import LogHandler
from ..lib import GetDictParam, CasesManager, CasesContainer

# PATH


CASE_PATH = 'cases/'
TESTCASES_PATH = 'testcases/'
REPORT_PATH = 'report/'
HEADERS_TEMPLATE_PATH = 'template/header.txt'
CONTENT_TEMPLATE_PATH = 'template/content.txt'
CASE_PATH = 'src/cases/'
TESTCASES_PATH = 'src/testcases/'
REPORT_PATH = 'src/report/'
HEADERS_TEMPLATE_PATH = 'src/template/header.txt'
CONTENT_TEMPLATE_PATH = 'src/template/content.txt'
DEBUG_INFO = 1


Expand Down
6 changes: 3 additions & 3 deletions report/测试报告.html → src/report/测试报告.html
Original file line number Diff line number Diff line change
Expand Up @@ -7115,7 +7115,7 @@ <h5>详细数据</h5>
"className": "TestJuheApi",
"methodName": "test_get_methods",
"description": "通过get方法请求聚合微信精选接口.",
"spendTime": "0.217 s",
"spendTime": "0.456 s",
"status": "成功",
"log": [
"Response : {'reason': '请求成功'}",
Expand All @@ -7127,7 +7127,7 @@ <h5>详细数据</h5>
"className": "TestJuheApi",
"methodName": "test_post_methods",
"description": "通过post方法请求聚合微信精选接口, 并拿到正确的返回结果",
"spendTime": "0.2 s",
"spendTime": "0.193 s",
"status": "成功",
"log": [
"Response : {'reason': '请求成功', 'list': ['len', 30], 'error_code': 0}",
Expand All @@ -7139,7 +7139,7 @@ <h5>详细数据</h5>
"testName": "测试deafult报告",
"testAll": 3,
"testFail": 0,
"beginTime": "2018-01-31 15:31:44",
"beginTime": "2018-01-31 15:59:16",
"totalTime": "1s",
"testSkip": 0,
"testError": 0
Expand Down
File renamed without changes.
9 changes: 0 additions & 9 deletions template/content.txt

This file was deleted.

16 changes: 0 additions & 16 deletions template/header.txt

This file was deleted.

Loading

0 comments on commit 93b9075

Please sign in to comment.