From 847b7eee8a0b3e78dec0a87e28b7ffc0768daafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Sodr=C3=A9?= Date: Fri, 15 Dec 2023 15:06:20 -0300 Subject: [PATCH] update test_occurrences_client revoming unused classes and update test_occurrences_w_format_param --- tests/test_occurrences_client.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/test_occurrences_client.py b/tests/test_occurrences_client.py index 85fc0b7..d5858fa 100644 --- a/tests/test_occurrences_client.py +++ b/tests/test_occurrences_client.py @@ -1,12 +1,10 @@ import datetime -from unittest.mock import patch from geopandas import GeoDataFrame from pandas import DataFrame from pandas.testing import assert_frame_equal from pytest import mark, raises -from crossfire import AsyncClient, Client from crossfire.clients.occurrences import ( Accumulator, Occurrences, @@ -137,16 +135,21 @@ async def test_occurrences_without_victims(occurrences_client_and_get_mock): @mark.asyncio -async def test_occurrences_with_format_parameter(occurrences_client_and_get_mock): +async def test_occurrences_with_format_parameter( + occurrences_client_and_get_mock, +): client, mock = occurrences_client_and_get_mock - occurrences = Occurrences(client, id_state=42, type_occurrence="withVictim") + occurrences = Occurrences( + client, id_state=42, type_occurrence="withVictim", format="df" + ) await occurrences() mock.assert_called_once_with( "http://127.0.0.1/api/v2/occurrences?idState=42&typeOccurrence=withVictim&page=1", headers={"Authorization": "Bearer 42"}, - format="None" + format="df", ) + def test_occurrence_raises_error_for_unknown_occurrence_type(): with raises(UnknownTypeOccurrenceError): Occurrences(None, id_state="42", type_occurrence="42")