Skip to content

Commit 5f9234e

Browse files
committed
Fixed tests after field names changes
1 parent 6389c87 commit 5f9234e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

tests/amqp/test_rpc_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ async def test_rpc_amqp_client_returns_an_error(event_loop):
5959
response = await client.send(payload={})
6060

6161
assert Response.ERROR_FIELD_NAME in response.keys()
62-
assert 'message' in response[Response.ERROR_FIELD_NAME].keys()
63-
assert response[Response.ERROR_FIELD_NAME]['message'] == VALIDATION_ERROR_DECR
62+
assert Response.ERROR_TYPE_FIELD_NAME in response[Response.ERROR_FIELD_NAME].keys()
63+
assert response[Response.ERROR_FIELD_NAME][Response.ERROR_TYPE_FIELD_NAME] == VALIDATION_ERROR # NOQA
6464

65-
assert 'type' in response[Response.ERROR_FIELD_NAME].keys()
66-
assert response[Response.ERROR_FIELD_NAME]['type'] == VALIDATION_ERROR
65+
assert Response.ERROR_DETAILS_FIELD_NAME in response[Response.ERROR_FIELD_NAME].keys()
66+
assert response[Response.ERROR_FIELD_NAME][Response.ERROR_DETAILS_FIELD_NAME] == VALIDATION_ERROR_DECR # NOQA
6767

6868
assert Response.EVENT_FIELD_NAME in response.keys()
6969
assert response[Response.EVENT_FIELD_NAME] is None

tests/test_wrappers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ def test_from_error_class_method(error_type, message, event_name):
2020
assert response.data[Response.EVENT_FIELD_NAME] == event_name
2121

2222
assert Response.ERROR_FIELD_NAME in response.data.keys()
23-
assert 'type' in response.data[Response.ERROR_FIELD_NAME].keys()
24-
assert response.data[Response.ERROR_FIELD_NAME]['type'] == error_type
23+
assert Response.ERROR_TYPE_FIELD_NAME in response.data[Response.ERROR_FIELD_NAME].keys()
24+
assert response.data[Response.ERROR_FIELD_NAME][Response.ERROR_TYPE_FIELD_NAME] == error_type
2525

26-
assert 'message' in response.data[Response.ERROR_FIELD_NAME].keys()
27-
assert response.data[Response.ERROR_FIELD_NAME]['message'] == message
26+
assert Response.ERROR_DETAILS_FIELD_NAME in response.data[Response.ERROR_FIELD_NAME].keys()
27+
assert response.data[Response.ERROR_FIELD_NAME][Response.ERROR_DETAILS_FIELD_NAME] == message
2828

2929

3030
@pytest.mark.parametrize("error_type, message, event_name", [
@@ -40,12 +40,12 @@ def test_from_error_with_a_message_without_the_period_in_the_end(error_type, mes
4040
assert response.data[Response.EVENT_FIELD_NAME] == event_name
4141

4242
assert Response.ERROR_FIELD_NAME in response.data.keys()
43-
assert 'type' in response.data[Response.ERROR_FIELD_NAME].keys()
44-
assert response.data[Response.ERROR_FIELD_NAME]['type'] == error_type
43+
assert Response.ERROR_TYPE_FIELD_NAME in response.data[Response.ERROR_FIELD_NAME].keys()
44+
assert response.data[Response.ERROR_FIELD_NAME][Response.ERROR_TYPE_FIELD_NAME] == error_type
4545

46-
assert 'message' in response.data[Response.ERROR_FIELD_NAME].keys()
47-
assert response.data[Response.ERROR_FIELD_NAME]['message'].endswith('.')
48-
assert response.data[Response.ERROR_FIELD_NAME]['message'] == "{}.".format(message)
46+
assert Response.ERROR_DETAILS_FIELD_NAME in response.data[Response.ERROR_FIELD_NAME].keys()
47+
assert response.data[Response.ERROR_FIELD_NAME][Response.ERROR_DETAILS_FIELD_NAME].endswith('.') # NOQA
48+
assert response.data[Response.ERROR_FIELD_NAME][Response.ERROR_DETAILS_FIELD_NAME] == "{}.".format(message) # NOQA
4949

5050

5151
@pytest.mark.parametrize("data, event_name", [

0 commit comments

Comments
 (0)