Skip to content

Commit

Permalink
update tests with new search filters
Browse files Browse the repository at this point in the history
  • Loading branch information
aschleg committed Feb 15, 2021
1 parent 33c8cca commit d5c2cd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion petpy/api.py
Expand Up @@ -384,6 +384,9 @@ def animals(self, animal_id=None, animal_type=None, breed=None, size=None, gende
good_with_children : bool, optional
good_with_cats : bool, optional
good_with_dogs : bool, optional
declawed : bool, optional
special_needs : bool, optional
house_trained : bool, optional
before_date : str, datetime
after_date : str, datetime
sort : {'recent', '-recent', 'distance', '-distance'}, optional
Expand Down Expand Up @@ -1027,7 +1030,7 @@ def _check_parameters(animal_types=None, size=None, gender=None, age=None, coat=
.format(coats=diff,
coat_list=_coats)

if status is not None and status not in _status:
if status is not None:
status_list = status.split(',')
diff = list(set(status_list).difference(_status))

Expand Down
6 changes: 5 additions & 1 deletion tests/test_api.py
Expand Up @@ -112,7 +112,7 @@ def test_animals():

response8 = pf.animals(good_with_dogs=1)
response9 = pf.animals(good_with_dogs=1, good_with_cats=1, good_with_children=1, return_df=True)
#response10 = pf.animals(special_needs=1, house_trained=1, declawed=1, return_df=True)
response10 = pf.animals(special_needs=1, house_trained=1, declawed=1, return_df=True)

assert isinstance(response1, dict)
assert len(response1['animals']) == 20
Expand Down Expand Up @@ -149,6 +149,10 @@ def test_animals():
assert all(x == response9['environment.children'][0] for x in response9['environment.children'])
assert all(x == response9['environment.dogs'][0] for x in response9['environment.dogs'])

assert all(x == response10['attributes.declawed'][0] for x in response10['attributes.declawed'])
assert all(x == response10['attributes.house_trained'][0] for x in response10['attributes.house_trained'])
assert all(x == response10['attributes.special_needs'][0] for x in response10['attributes.special_needs'])


@vcr.use_cassette('tests/cassettes/organizations.yml')
def test_organizations():
Expand Down

0 comments on commit d5c2cd4

Please sign in to comment.