예제 #1
0
파일: steps.py 프로젝트: laranea/corepost
def then_i_expect_json(content):
    expected_json = json.loads(content)
    expected_json_sorted = json.dumps(expected_json, sort_keys=True, indent=4)
    received_json = json.loads(scc.content)
    received_json_sorted = json.dumps(received_json, sort_keys=True, indent=4)
    assert_equals(
        expected_json_sorted, received_json_sorted,
        "Expected JSON\n%s\n*** actual ****\n%s" %
        (expected_json_sorted, received_json_sorted))
예제 #2
0
def then_i_expect_json(content):
    expected_json = json.loads(content) 
    expected_json_sorted = json.dumps(expected_json,sort_keys=True,indent=4)
    received_json = json.loads(scc.content)
    received_json_sorted = json.dumps(received_json,sort_keys=True,indent=4)
    assert_equals(expected_json_sorted,received_json_sorted,"Expected JSON\n%s\n*** actual ****\n%s" % (expected_json_sorted,received_json_sorted))
예제 #3
0
def expect_http_code(code):
    assert_equals(int(code),int(scc.response.status), msg="%s != %s\n%s\n%s" % (code,scc.response.status,scc.response,scc.content))
예제 #4
0
def expect_http_code(code):
    assert_equals(int(code),int(scc.response.status), msg="%s != %s\n%s\n%s" % (code,scc.response.status,scc.response,scc.content))