diff --git a/Public/tsest_log.py b/Public/tsest_log.py index 305f1ad..02d49fe 100644 --- a/Public/tsest_log.py +++ b/Public/tsest_log.py @@ -9,8 +9,8 @@ class log_re(): def __init__(self,title): self.day = time.strftime("%Y%m%d%H%M", time.localtime(time.time())) self.logger = logging.Logger(title) + file = r'C:\Users\Administrator\Desktop\xuexi\jiejko\TestLog\%s.log' % self.day self.logger.setLevel(logging.INFO) - file=r'C:\Users\Administrator\Desktop\jiejko\TestLog\%s.log' % self.day if os.path.exists(file) is False: os.system(r'touch %s' % file) self.logfile = logging.FileHandler(file) diff --git a/TestLog/201708012114.log b/TestLog/201708012114.log new file mode 100644 index 0000000..e9f7e13 --- /dev/null +++ b/TestLog/201708012114.log @@ -0,0 +1,4 @@ +2017-08-01 21:14:09,083 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:14:29,303 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:14:40,844 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:14:40,911 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012115.log b/TestLog/201708012115.log new file mode 100644 index 0000000..ed0e1a6 --- /dev/null +++ b/TestLog/201708012115.log @@ -0,0 +1,8 @@ +2017-08-01 21:15:28,999 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:15:29,097 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:15:32,359 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:15:32,439 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:15:39,693 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:15:39,751 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:15:58,937 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:15:59,000 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012116.log b/TestLog/201708012116.log new file mode 100644 index 0000000..c59e670 --- /dev/null +++ b/TestLog/201708012116.log @@ -0,0 +1,2 @@ +2017-08-01 21:16:28,535 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:16:28,600 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012118.log b/TestLog/201708012118.log new file mode 100644 index 0000000..991e939 --- /dev/null +++ b/TestLog/201708012118.log @@ -0,0 +1,2 @@ +2017-08-01 21:18:08,334 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:18:11,444 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012119.log b/TestLog/201708012119.log new file mode 100644 index 0000000..d9e05fd --- /dev/null +++ b/TestLog/201708012119.log @@ -0,0 +1,4 @@ +2017-08-01 21:19:16,755 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:19:16,819 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:19:19,153 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:19:19,233 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012120.log b/TestLog/201708012120.log new file mode 100644 index 0000000..a7ad246 --- /dev/null +++ b/TestLog/201708012120.log @@ -0,0 +1,12 @@ +2017-08-01 21:20:00,946 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:01,034 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:02,994 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:03,068 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:07,572 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:07,640 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:24,807 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:24,898 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:34,996 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:35,055 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:56,871 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:20:56,925 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012121.log b/TestLog/201708012121.log new file mode 100644 index 0000000..40ba618 --- /dev/null +++ b/TestLog/201708012121.log @@ -0,0 +1,4 @@ +2017-08-01 21:21:16,470 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:21:16,528 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:21:54,863 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:21:54,932 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012122.log b/TestLog/201708012122.log new file mode 100644 index 0000000..74be073 --- /dev/null +++ b/TestLog/201708012122.log @@ -0,0 +1,4 @@ +2017-08-01 21:22:05,291 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:22:05,370 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:22:55,725 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:22:55,788 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012123.log b/TestLog/201708012123.log new file mode 100644 index 0000000..28ff667 --- /dev/null +++ b/TestLog/201708012123.log @@ -0,0 +1,4 @@ +2017-08-01 21:23:25,199 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:23:25,280 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:23:36,166 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:23:36,242 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012124.log b/TestLog/201708012124.log new file mode 100644 index 0000000..8563c98 --- /dev/null +++ b/TestLog/201708012124.log @@ -0,0 +1,7 @@ +2017-08-01 21:24:23,149 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:24:23,207 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:24:36,462 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:24:36,543 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:24:51,773 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:24:52,410 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:24:52,558 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012125.log b/TestLog/201708012125.log new file mode 100644 index 0000000..e0dac69 --- /dev/null +++ b/TestLog/201708012125.log @@ -0,0 +1,2 @@ +2017-08-01 21:25:18,707 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:25:18,808 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 diff --git a/TestLog/201708012126.log b/TestLog/201708012126.log new file mode 100644 index 0000000..17ba9f5 --- /dev/null +++ b/TestLog/201708012126.log @@ -0,0 +1,6 @@ +2017-08-01 21:26:25,141 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:26:25,214 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '干啥呀?'},预期:40008.0 +2017-08-01 21:26:25,286 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:26:25,353 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '此时无声胜有声?'},预期:40008.0 diff --git a/TestLog/201708012127.log b/TestLog/201708012127.log new file mode 100644 index 0000000..90d13d7 --- /dev/null +++ b/TestLog/201708012127.log @@ -0,0 +1,30 @@ +2017-08-01 21:27:09,499 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:09,573 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '是不是有什么难言之隐呢?'},预期:40008.0 +2017-08-01 21:27:09,653 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:09,731 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '有什么想说的话,不用藏在心里,可以直接告诉我哦~'},预期:40008.0 +2017-08-01 21:27:37,612 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:37,695 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '你想说什么就直说,不用藏在心里哈~'},预期:40008.0 +2017-08-01 21:27:37,762 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:37,823 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '有啥事吗?'},预期:40008.0 +2017-08-01 21:27:39,828 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:39,891 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '是不是有什么难言之隐呢?'},预期:40008.0 +2017-08-01 21:27:39,962 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:40,027 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '你想说啥呢?'},预期:40008.0 +2017-08-01 21:27:42,238 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:42,328 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '干哈呀?'},预期:40008.0 +2017-08-01 21:27:42,409 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:42,493 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '是不是有什么难言之隐呢?'},预期:40008.0 +2017-08-01 21:27:52,737 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:52,805 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '此时无声胜有声?'},预期:40008.0 +2017-08-01 21:27:52,875 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:27:52,946 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '你想说什么就直说,不用藏在心里哈~'},预期:40008.0 diff --git a/TestLog/201708012128.log b/TestLog/201708012128.log new file mode 100644 index 0000000..0b20852 --- /dev/null +++ b/TestLog/201708012128.log @@ -0,0 +1,12 @@ +2017-08-01 21:28:01,891 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:28:01,976 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '有什么想说的话,不用藏在心里,可以直接告诉我哦~'},预期:40008.0 +2017-08-01 21:28:02,044 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:28:02,114 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '你想说啥呢?'},预期:40008.0 +2017-08-01 21:28:45,682 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:28:45,756 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': 'what?'},预期:40008.0 +2017-08-01 21:28:45,815 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:28:45,874 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '此时无声胜有声?'},预期:40008.0 diff --git a/TestLog/201708012129.log b/TestLog/201708012129.log new file mode 100644 index 0000000..370a5d9 --- /dev/null +++ b/TestLog/201708012129.log @@ -0,0 +1,6 @@ +2017-08-01 21:29:20,211 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:29:20,277 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '有什么想说的话,不用藏在心里,可以直接告诉我哦~'},预期:40008.0 +2017-08-01 21:29:20,345 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:29:20,408 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '此时无声胜有声?'},预期:40008.0 diff --git a/TestLog/201708012130.log b/TestLog/201708012130.log new file mode 100644 index 0000000..c327e64 --- /dev/null +++ b/TestLog/201708012130.log @@ -0,0 +1,3 @@ +2017-08-01 21:30:18,623 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:30:18,689 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '有些话,难以说出口?'},预期:40008.0 diff --git a/TestLog/201708012131.log b/TestLog/201708012131.log new file mode 100644 index 0000000..e69de29 diff --git a/TestLog/201708012132.log b/TestLog/201708012132.log new file mode 100644 index 0000000..ba167ca --- /dev/null +++ b/TestLog/201708012132.log @@ -0,0 +1,3 @@ +2017-08-01 21:32:42,952 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:32:43,043 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '干哈呀?'},预期:40008.0 diff --git a/TestLog/201708012133.log b/TestLog/201708012133.log new file mode 100644 index 0000000..be69838 --- /dev/null +++ b/TestLog/201708012133.log @@ -0,0 +1,3 @@ +2017-08-01 21:33:30,110 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:33:30,179 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '有什么想说的话,不用藏在心里,可以直接告诉我哦~'},预期:40008.0 diff --git a/TestLog/201708012135.log b/TestLog/201708012135.log new file mode 100644 index 0000000..9e68b1b --- /dev/null +++ b/TestLog/201708012135.log @@ -0,0 +1,3 @@ +2017-08-01 21:35:00,247 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:35:00,350 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '你想和我说什么呢?'},预期:40008.0 diff --git a/TestLog/201708012137.log b/TestLog/201708012137.log new file mode 100644 index 0000000..38be437 --- /dev/null +++ b/TestLog/201708012137.log @@ -0,0 +1,6 @@ +2017-08-01 21:37:35,480 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:37:35,543 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '干啥呀?'},预期:40008.0 +2017-08-01 21:37:50,944 - 测试日志 - INFO - inputdata> 参数:sasa, url:http://www.tuling123.com/openapi/api ,返回:{'code': 40001, 'text': '亲爱的,key不对哦。'},预期:40002.0 +2017-08-01 21:37:51,019 - 测试日志 - INFO - inputdata> 参数:, url:http://www.tuling123.com/openapi/api + ,返回:{'code': 40002, 'text': '干啥呀?'},预期:40008.0 diff --git a/main_excel_report.py b/main_excel_report.py index d3db837..c710f96 100644 --- a/main_excel_report.py +++ b/main_excel_report.py @@ -8,25 +8,23 @@ """ from Public.pyreport_excel import create import unittest,os,threading,datetime -from testCase.test_case import Testinface +from testCase.test_case import testinterface from Public.emmail import sendemali +from Public.get_excel import datacel def start(): - suite = unittest.TestSuite() - suite.addTest(Testinface("testinterface")) - me=Testinface() - list_fail, list_pass, list_json, listurls, listkeys, listconeents, listfangshis, listqiwangs, listids, listrelust, listnames=me.testinterface() - filepath =r'C:\Users\Administrator\Desktop\jiejko\test_Report\relult.xls' + listid,listkey,listconeent,listurl,listfangshi,listqiwang,listname=datacel() + listrelust,list_fail, list_pass, list_json =testinterface() + filepath =r'C:\Users\Administrator\Desktop\xuexi\jiejko\test_Report\relult.xls' if os.path.exists(filepath) is False: os.system(r'touch %s' % filepath) - create(filepath,list_fail=list_fail, list_pass=list_pass, list_json=list_json, listurls=listurls, listkeys=listkeys,listconeents=listconeents, listfangshis=listfangshis, listqiwangs=listqiwangs, listids=listids, listrelust=listrelust, listnames=listnames) - # sendemali(filepath) -def testThread(): + create(filename=filepath,list_fail=list_fail, list_pass=list_pass, list_json=list_json, listurls=listurl, + listkeys=listkey,listconeents=listconeent, listfangshis=listfangshi, listqiwangs=listqiwang, + listids=listid, listrelust=listrelust, listnames=listname) +def teThread(): st = datetime.datetime.now() m = threading.Thread(target=start, args=()) m.run() end = datetime.datetime.now() print(end - st) - - if __name__ == '__main__': - testThread() \ No newline at end of file + start() \ No newline at end of file diff --git a/main_html.py b/main_html.py index 8b68471..2cce7a4 100644 --- a/main_html.py +++ b/main_html.py @@ -1,30 +1,31 @@ # -*- coding: utf-8 -*- # @Author : leizi import unittest,os,datetime,time -from testCase.test_case import Testinface +from testCase.test_case import testinterface from Public.py_Html import createHtml +from Public.get_excel import datacel from Public.emmail import sendemali import threading def stast(): starttime=datetime.datetime.now() - suite = unittest.TestSuite() - suite.addTest(Testinface("testinterface")) - me=Testinface() - list_fail, list_pass, list_json, listurls, listkeys, listconeents, listfangshis, listqiwangs, listids, listrelust, listnames=me.testinterface() - filepath =r'C:\Users\Administrator\Desktop\jiejko\test_Report\relult.html' + listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname = datacel() + listrelust, list_fail, list_pass, list_json = testinterface() + filepath =r'C:\Users\Administrator\Desktop\xuexi\jiejko\test_Report\relult.html' if os.path.exists(filepath) is False: os.system(r'touch %s' % filepath) endtime=datetime.datetime.now() - createHtml(titles='鎺ュ彛娴嬭瘯鎶ュ憡',filepath=filepath,starttime=starttime,endtime=endtime,passge=list_pass,fail=list_fail,id=listids,name=listnames,key=listkeys,coneent=listconeents,url=listurls,meth=listfangshis,yuqi=listqiwangs,json=list_json,relusts=listrelust) + createHtml(titles='鎺ュ彛娴嬭瘯鎶ュ憡',filepath=filepath,starttime=starttime, + endtime=endtime,passge=list_pass,fail=list_fail, + id=listid,name=listname,key=listkey,coneent=listconeent,url=listurl,meth=listfangshi, + yuqi=listqiwang,json=list_json,relusts=listrelust) # sendemali(filepath) -def testThread(): +def tThread(): st=datetime.datetime.now() m=threading.Thread(target=stast,args=()) m.run() end=datetime.datetime.now() - print(end-st) if __name__ == '__main__': - testThread() + tThread() diff --git a/testCase/test_case.py b/testCase/test_case.py index 8b98a8d..dae775f 100644 --- a/testCase/test_case.py +++ b/testCase/test_case.py @@ -11,48 +11,22 @@ from Public.tsest_log import log_re listid,listkey,listconeent,listurl,listfangshi,listqiwang,listname=datacel() title='娴嬭瘯鏃ュ織' log_can=log_re(title) -class Testinface(unittest.TestCase): - def setUp(self): - pass - def tearDown(self): - pass - def testinterface(self): - list_pass = 0 - list_fail = 0 - list_json = [] - listrelust=[] - listurls=[] - listkeys=[] - listids=[] - listconeents=[] - listfangshis=[] - listqiwangs=[] - listnames=[] - for i in range(len(listurl)): - api=TestApi(url=listurl[i],key=listkey[i],connent=listconeent[i],fangshi=listfangshi[i]) - apicode=api.getcode() - apijson=api.getJson() - log_can.info_log('inputdata> 鍙傛暟:%s, url:%s ,杩斿洖:%s,棰勬湡:%s'%(listconeent[i],listurl[i],apijson,listqiwang[i])) - if apicode==int(listqiwang[i]): - listids.append(listid[i]) - listurls.append(listurl[i]) - listkeys.append(listkey[i]) - listconeents.append(listconeent[i]) - listfangshis.append(listfangshi[i]) - listqiwangs.append(listqiwang[i]) - listnames.append(listname[i]) - list_json.append((apijson)) - listrelust.append('pass') - list_pass += 1 - else: - listids.append(listid[i]) - listurls.append(listurl[i]) - listkeys.append(listkey[i]) - listconeents.append(listconeent[i]) - listfangshis.append(listfangshi[i]) - listqiwangs.append(listqiwang[i]) - listnames.append(listname[i]) - list_fail+=1 - listrelust.append('fail') - list_json.append((apijson)) - return list_fail,list_pass,list_json,listurls,listkeys,listconeents,listfangshis,listqiwangs,listids,listrelust,listnames +def testinterface(): + list_pass = 0 + list_fail = 0 + list_json = [] + listrelust=[] + for i in range(len(listurl)): + api=TestApi(url=listurl[i],key=listkey[i],connent=listconeent[i],fangshi=listfangshi[i]) + apicode=api.getcode() + apijson=api.getJson() + log_can.info_log('inputdata> 鍙傛暟:%s, url:%s ,杩斿洖:%s,棰勬湡:%s'%(listconeent[i],listurl[i],apijson,listqiwang[i])) + if apicode==int(listqiwang[i]): + list_json.append(apijson) + listrelust.append('pass') + list_pass += 1 + else: + list_fail+=1 + listrelust.append('fail') + list_json.append(apijson) + return listrelust,list_fail,list_pass,list_json \ No newline at end of file diff --git a/test_Data/test_data.xlsx b/test_Data/test_data.xlsx index e3248e4..461990b 100644 Binary files a/test_Data/test_data.xlsx and b/test_Data/test_data.xlsx differ diff --git a/test_Report/relult.html b/test_Report/relult.html index 3917188..d541a1e 100644 --- a/test_Report/relult.html +++ b/test_Report/relult.html @@ -11,12 +11,12 @@
寮濮嬫椂闂: 2017-06-17 20:19:43.000185
-缁撴潫鏃堕棿: 2017-06-17 20:19:44.499271
-鑰楁椂: 0:00:01.499086
+寮濮嬫椂闂: 2017-08-01 21:37:50.879238
+缁撴潫鏃堕棿: 2017-08-01 21:37:51.057248
+鑰楁椂: 0:00:00.178010
缁撴灉: - Pass: 16 - Fail: 8 + Pass: 0 + Fail: 2
娴嬭瘯璇︽儏濡備笅