Skip to content

Commit

Permalink
update test_occurrences_client revoming unused classes and update tes…
Browse files Browse the repository at this point in the history
…t_occurrences_w_format_param
  • Loading branch information
FelipeSBarros committed Dec 15, 2023
1 parent 8840252 commit 847b7ee
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/test_occurrences_client.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 847b7ee

Please # to comment.