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))
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))
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))