Skip to content

Commit

Permalink
fixed codecov for LookupValidation.__repr__
Browse files Browse the repository at this point in the history
  • Loading branch information
iwpnd committed Feb 25, 2020
1 parent 48f303e commit c3706e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion flashgeotext/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
self.errors = {}

def __repr__(self):
return f"{self.__dict__}"
return f"<LookupValidation: {self.__dict__}>"


class LookupData(BaseModel, object):
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/test_lookup_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from flashgeotext.lookup import load_data_from_file
from flashgeotext.lookup import LookupData
from flashgeotext.lookup import LookupValidation
from flashgeotext.settings import DEMODATA_CITIES
from flashgeotext.settings import DEMODATA_COUNTRIES

Expand Down Expand Up @@ -70,3 +71,12 @@ def test_lookup_data_validate_repr():
lookup = LookupData(name="countries", data=load_data_from_file(DEMODATA_COUNTRIES))

assert isinstance(lookup.validate(), dict)


def test_lookupvalidation_repr():
validation = LookupValidation()

assert (
repr(validation)
== "<LookupValidation: {'status': 'No errors detected', 'error_count': 0, 'errors': {}}>"
)

0 comments on commit c3706e8

Please sign in to comment.