- TestReport

# Test Report:

## Summary

START AT | 2019-03-06 19:39:29
DURATION | 0.281 seconds
PLATFORM | zybats 2.0.2.0 | CPython 3.7.0 | Windows-10-10.0.17134-SP0
STAT | TESTCASES (success/fail) | TESTSTEPS (success/fail/error/skip)
--- | --- | ---
total (details) => | 1 (0/1) | 3 (2/1/0/0)

## Details

### Shows how to use zybats ext api.

TOTAL: 3 | SUCCESS: 2 | FAILED: 1 | ERROR: 0 | SKIPPED: 0
Status | Name | Response Time | Detail
--- | --- | --- | ---
success | get token (setup) | 22.94 ms | log-1 ## Request and Response data × ### Name: get token (setup) ### Request:
url | http://127.0.0.1:8080/api/getTokenId
method | POST
headers | User-Agent: python-requests/2.19.1 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Content-Type: application/json Content-Length: 107
body | {"user_agent": "iOS/10.3", "device_sn": "TESTCASE_SETUP_XXX", "os_platform": "ios", "app_version": "2.8.6"}
### Response:
ok | True
url | http://127.0.0.1:8080/api/getTokenId
status_code | 200
reason |
cookies | {}
encoding | UTF-8
headers | Content-Type: text/plain;charset=UTF-8 Content-Length: 77 Date: Wed, 06 Mar 2019 11:39:29 GMT
content_type | text/plain;charset=UTF-8
json | {'id': '11', 'request': {'base_url': '', 'headers': {'User-Agent': 'homeworkGray'}}}
### Validators:
check | comparator | expect value | actual value
--- | --- | --- | ---
status_code | eq | 200 | 200
### Statistics:
content_size(bytes) | 77
response_time(ms) | 22.94
elapsed(ms) | 15.041
failure | use redis ext api example | 15.96 ms | log-1 ## Request and Response data × ### Name: use redis ext api example ### Request:
url | http://127.0.0.1:8080/set/redis
method | POST
headers | User-Agent: python-requests/2.19.1 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 132
body | {"ZYBUSS": "R2wZjrBdSurcW71Ed_nra2QQBcvAQb2gdRAIXRg5NDorqOZC6_SWIVZce5dR7o0u", "_t_": "1544443254", "appId": "homework", "id": "11"}
### Response:
ok | True
url | http://127.0.0.1:8080/set/redis
status_code | 200
reason |
cookies | {}
encoding | UTF-8
headers | Content-Type: text/plain;charset=UTF-8 Content-Length: 12 Date: Wed, 06 Mar 2019 11:39:29 GMT
content_type | text/plain;charset=UTF-8
json | {'msg': 'ok'}
### Validators:
check | comparator | expect value | actual value
--- | --- | --- | ---
status_code | eq | 200 | 200
${get_redis_str_value($query_redis_key)} | eq | 67 | b'67'
### Statistics:
content_size(bytes) | 12
response_time(ms) | 15.96
elapsed(ms) | 12.259
traceback ## Traceback Message ×
    Traceback (most recent call last):
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\core\api.py", line 55, in test
        test_runner.run_test(test_dict)
    zybats.exceptions.ValidationFailure: validate: ${get_redis_str_value($query_redis_key)} equals 67(str)	==> fail
    b'67'(bytes) equals 67(str)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\core\api.py", line 57, in test
        self.fail(str(ex))
    AssertionError: validate: ${get_redis_str_value($query_redis_key)} equals 67(str)	==> fail
    b'67'(bytes) equals 67(str)
success | use mysql ext api example | 42.91 ms | log-1 ## Request and Response data × ### Name: use mysql ext api example ### Request:
url | http://127.0.0.1:8080/set/mysql
method | POST
headers | User-Agent: python-requests/2.19.1 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 132
body | {"ZYBUSS": "R2wZjrBdSurcW71Ed_nra2QQBcvAQb2gdRAIXRg5NDorqOZC6_SWIVZce5dR7o0u", "_t_": "1544443254", "appId": "homework", "id": "11"}
### Response:
ok | True
url | http://127.0.0.1:8080/set/mysql
status_code | 200
reason |
cookies | {}
encoding | UTF-8
headers | Content-Type: text/plain;charset=UTF-8 Content-Length: 12 Date: Wed, 06 Mar 2019 11:39:29 GMT
content_type | text/plain;charset=UTF-8
json | {'msg': 'ok'}
### Validators:
check | comparator | expect value | actual value
--- | --- | --- | ---
status_code | eq | 200 | 200
${query_mysql_one_result($sql_str)} | eq | 67 | 67
### Statistics:
content_size(bytes) | 12
response_time(ms) | 42.91
elapsed(ms) | 40.302