Skip to content

Commit

Permalink
OPT: no need to define an empty model for an empty request 🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Nov 17, 2023
1 parent 05dfbc0 commit d52afe6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/integration/test_country_info_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@
from zeep import Client

from combadge.core.interfaces import SupportsService
from combadge.support.http.markers import Payload
from combadge.support.soap.markers import operation_name
from combadge.support.zeep.backends.sync import ZeepBackend


class CountryInfoRequest(BaseModel):
"""The service method takes no parameters."""


class Continent(BaseModel):
code: Annotated[str, Field(alias="sCode")]
name: Annotated[str, Field(alias="sName")]
Expand All @@ -25,7 +20,7 @@ class Continent(BaseModel):
class SupportsCountryInfo(SupportsService, Protocol):
@operation_name("ListOfContinentsByName")
@abstractmethod
def list_of_continents_by_name(self, request: Payload[CountryInfoRequest]) -> List[Continent]:
def list_of_continents_by_name(self) -> List[Continent]:
raise NotImplementedError


Expand All @@ -37,7 +32,7 @@ def country_info_service() -> Iterable[SupportsCountryInfo]:

@pytest.mark.vcr(decode_compressed_response=True)
def test_happy_path(country_info_service: SupportsCountryInfo) -> None:
continents = country_info_service.list_of_continents_by_name(CountryInfoRequest())
continents = country_info_service.list_of_continents_by_name()

assert isinstance(continents, list)
assert len(continents) == 6
Expand Down

0 comments on commit d52afe6

Please sign in to comment.