def test_raises_network_error_when_counting_messages_raises_an_http_error(): mesh_inbox = mock_mesh_inbox(count_messages_error=mesh_client_http_error()) with pytest.raises(MeshClientNetworkError) as e: mesh_inbox.count_messages() assert str(e.value) == f"400 HTTP Error: Bad request for url: {TEST_INBOX_URL}"
def test_mesh_network_error_raised_when_ack_raises_http_error(): client_message = mock_client_message( acknowledge_error=mesh_client_http_error()) message = MeshMessage(client_message) with pytest.raises(MeshClientNetworkError) as e: message.acknowledge() assert e.value.error_message == f"400 HTTP Error: Bad request for url: {TEST_INBOX_URL}"
def mock_iterate_all_messages(): raise mesh_client_http_error() yield mock_client_message()
def mock_retrieve_message(message_id): raise mesh_client_http_error()
def mock_list_messages(): raise mesh_client_http_error()