- TestReport

# Test Report:

## Summary

START AT | 2019-03-06 17:16:59
DURATION | 1.060 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/0/1/0)

## Details

### Shows how to use zybats ext api.

TOTAL: 3 | SUCCESS: 2 | FAILED: 0 | ERROR: 1 | SKIPPED: 0
Status | Name | Response Time | Detail
--- | --- | --- | ---
success | get token (setup) | 538.34 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 09:17:00 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) | 538.34
elapsed(ms) | 520.826
success | use redis ext api example | 62.94 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 09:17:00 GMT
content_type | text/plain;charset=UTF-8
json | {'msg': 'ok'}
### Validators:
check | comparator | expect value | actual value
--- | --- | --- | ---
status_code | eq | 200 | 200
### Statistics:
content_size(bytes) | 12
response_time(ms) | 62.94
elapsed(ms) | 49.096
error | use mysql ext api example | 24.93 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 09:17:00 GMT
content_type | text/plain;charset=UTF-8
json | {'msg': 'ok'}
### Validators:
check | comparator | expect value | actual value
--- | --- | --- | ---
status_code | eq | 200 | 200
### Statistics:
content_size(bytes) | 12
response_time(ms) | 24.93
elapsed(ms) | 11.994
traceback ## Traceback Message ×
    Traceback (most recent call last):
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 369, in get_mapping_variable
        return variables_mapping[variable_name]
    KeyError: 'sql_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 55, in test
        test_runner.run_test(test_dict)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\runner.py", line 359, in run_test
        self._run_test(test_dict)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\runner.py", line 257, in _run_test
        self.session_context.validate(validators, resp_obj)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\context.py", line 185, in validate
        resp_obj
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\context.py", line 104, in __eval_check_item
        check_value = self.eval_content(check_item)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\context.py", line 70, in eval_content
        self.FUNCTIONS_MAPPING
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 601, in parse_data
        functions_mapping
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 436, in parse_string_functions
        args = parse_data(args, variables_mapping, functions_mapping)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 567, in parse_data
        for item in content
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 567, in <listcomp>
        for item in content
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 607, in parse_data
        functions_mapping
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 485, in parse_string_variables
        variable_value = get_mapping_variable(variable_name, variables_mapping)
      File "c:\users\zuoyebang\appdata\local\programs\python\python37\lib\site-packages\zybats\parser.py", line 371, in get_mapping_variable
        raise exceptions.VariableNotFound("{} is not found.".format(variable_name))
    zybats.exceptions.VariableNotFound: sql_str is not found.