mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
changed testcases to not check for error logs as we moved this to debug logs
checks/asserts can be re-integrated asap we are able to set the debuglevel in for the single use cases Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
0c2d4487cb
commit
8d4f95cb82
@ -177,14 +177,15 @@ def test_post_create_transaction_with_invalid_id(mock_logger, b, client):
|
||||
).format(InvalidHash.__name__, tx["id"])
|
||||
assert res.status_code == expected_status_code
|
||||
assert res.json["message"] == expected_error_message
|
||||
assert mock_logger.error.called
|
||||
assert "HTTP API error: %(status)s - %(method)s:%(path)s - %(message)s" in mock_logger.error.call_args[0]
|
||||
assert {
|
||||
"message": expected_error_message,
|
||||
"status": expected_status_code,
|
||||
"method": "POST",
|
||||
"path": TX_ENDPOINT,
|
||||
} in mock_logger.error.call_args[0]
|
||||
# TODO change the loglevel to DEBUG for this test case to enable the following 3 asserts
|
||||
#assert mock_logger.error.called
|
||||
#assert "HTTP API error: %(status)s - %(method)s:%(path)s - %(message)s" in mock_logger.error.call_args[0]
|
||||
#assert {
|
||||
# "message": expected_error_message,
|
||||
# "status": expected_status_code,
|
||||
# "method": "POST",
|
||||
# "path": TX_ENDPOINT,
|
||||
#} in mock_logger.error.call_args[0]
|
||||
# TODO put back caplog based asserts once possible
|
||||
# assert caplog.records[0].args['status'] == expected_status_code
|
||||
# assert caplog.records[0].args['message'] == expected_error_message
|
||||
@ -215,14 +216,15 @@ def test_post_create_transaction_with_invalid_signature(mock_logger, b, client):
|
||||
)
|
||||
assert res.status_code == expected_status_code
|
||||
assert res.json["message"] == expected_error_message
|
||||
assert mock_logger.error.called
|
||||
assert "HTTP API error: %(status)s - %(method)s:%(path)s - %(message)s" in mock_logger.error.call_args[0]
|
||||
assert {
|
||||
"message": expected_error_message,
|
||||
"status": expected_status_code,
|
||||
"method": "POST",
|
||||
"path": TX_ENDPOINT,
|
||||
} in mock_logger.error.call_args[0]
|
||||
# TODO change the loglevel to DEBUG for this test case to enable the following 3 asserts
|
||||
#assert mock_logger.error.called
|
||||
#assert "HTTP API error: %(status)s - %(method)s:%(path)s - %(message)s" in mock_logger.error.call_args[0]
|
||||
#assert {
|
||||
# "message": expected_error_message,
|
||||
# "status": expected_status_code,
|
||||
# "method": "POST",
|
||||
# "path": TX_ENDPOINT,
|
||||
#} in mock_logger.error.call_args[0]
|
||||
# TODO put back caplog based asserts once possible
|
||||
# assert caplog.records[0].args['status'] == expected_status_code
|
||||
# assert caplog.records[0].args['message'] == expected_error_message
|
||||
@ -265,14 +267,15 @@ def test_post_create_transaction_with_invalid_schema(mock_logger, client):
|
||||
)
|
||||
assert res.status_code == expected_status_code
|
||||
assert res.json["message"] == expected_error_message
|
||||
assert mock_logger.error.called
|
||||
assert "HTTP API error: %(status)s - %(method)s:%(path)s - %(message)s" in mock_logger.error.call_args[0]
|
||||
assert {
|
||||
"message": expected_error_message,
|
||||
"status": expected_status_code,
|
||||
"method": "POST",
|
||||
"path": TX_ENDPOINT,
|
||||
} in mock_logger.error.call_args[0]
|
||||
# TODO change the loglevel to DEBUG for this test case to enable the following 3 asserts
|
||||
#assert mock_logger.error.called
|
||||
#assert "HTTP API error: %(status)s - %(method)s:%(path)s - %(message)s" in mock_logger.error.call_args[0]
|
||||
#assert {
|
||||
# "message": expected_error_message,
|
||||
# "status": expected_status_code,
|
||||
# "method": "POST",
|
||||
# "path": TX_ENDPOINT,
|
||||
#} in mock_logger.error.call_args[0]
|
||||
# TODO put back caplog based asserts once possible
|
||||
# assert caplog.records[0].args['status'] == expected_status_code
|
||||
# assert caplog.records[0].args['message'] == expected_error_message
|
||||
@ -312,14 +315,15 @@ def test_post_invalid_transaction(
|
||||
expected_error_message = "Invalid transaction ({}): {}".format(exc, msg)
|
||||
assert res.status_code == expected_status_code
|
||||
assert res.json["message"] == "Invalid transaction ({}): {}".format(exc, msg)
|
||||
assert mock_logger.error.called
|
||||
assert "HTTP API error: %(status)s - %(method)s:%(path)s - %(message)s" in mock_logger.error.call_args[0]
|
||||
assert {
|
||||
"message": expected_error_message,
|
||||
"status": expected_status_code,
|
||||
"method": "POST",
|
||||
"path": TX_ENDPOINT,
|
||||
} in mock_logger.error.call_args[0]
|
||||
# TODO change the loglevel to DEBUG for this test case to enable the following 3 asserts
|
||||
#assert mock_logger.error.called
|
||||
#assert "HTTP API error: %(status)s - %(method)s:%(path)s - %(message)s" in mock_logger.error.call_args[0]
|
||||
#assert {
|
||||
# "message": expected_error_message,
|
||||
# "status": expected_status_code,
|
||||
# "method": "POST",
|
||||
# "path": TX_ENDPOINT,
|
||||
#} in mock_logger.error.call_args[0]
|
||||
# TODO put back caplog based asserts once possible
|
||||
# assert caplog.records[2].args['status'] == expected_status_code
|
||||
# assert caplog.records[2].args['message'] == expected_error_message
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user