Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fields optional #56

Merged
merged 1 commit into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pygleif/api/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class Address(BaseModel):
)
mail_routing: Optional[str] = Field(alias="mailRouting")
city: str = Field(alias="city")
region: str = Field(alias="region")
region: Optional[str] = Field(alias="region")
country: str = Field(alias="country")
postal_code: str = Field(alias="postalCode")
postal_code: Optional[str] = Field(alias="postalCode")


class Expiration(BaseModel):
Expand Down
7 changes: 7 additions & 0 deletions tests/test_gleif.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ def test_search_lei(gleif_search_fixture: Search):
def test_search_id(gleif_search_fixture: Search):
"""Test ID attribute."""
assert gleif_search_fixture.response.data[0].id, "549300MLUDYVRQOOXS22"


@pytest.mark.parametrize("lei", ["969500NTPM8P4LAT9V13"])
def test_different_lei(lei: str):
"""Test various LEI."""
PyGleif(lei_code=lei)
assert True