[patch] Update return for is_workfout_present function (#100)
All checks were successful
Prepare releases / coverage (push) Successful in 19s
All checks were successful
Prepare releases / coverage (push) Successful in 19s
Reviewed-on: #100
This commit is contained in:
parent
ff3bac5b5f
commit
1078a8670b
|
@ -156,17 +156,7 @@ class Fittrackee:
|
|||
results = r.json()
|
||||
log.debug(f"Workkouts: {results['data']['workouts']}")
|
||||
log.debug(f"Count workkouts: {len(results['data']['workouts'])}")
|
||||
log.debug(f"As next : {results['pagination']['has_next']}")
|
||||
log.debug(f"As prev : {results['pagination']['has_prev']}")
|
||||
log.debug(f"Pagination pages : {results['pagination']['pages']}")
|
||||
log.debug(f"Pagination total : {results['pagination']['total']}")
|
||||
return (
|
||||
len(results["data"]["workouts"]) == 0
|
||||
and results["pagination"]["has_next"] is True
|
||||
and results["pagination"]["has_prev"] is False
|
||||
and results["pagination"]["pages"] == 0
|
||||
and results["pagination"]["total"] == 0
|
||||
)
|
||||
return len(results["data"]["workouts"]) != 0
|
||||
|
||||
def get_all_workouts(self, pagination: int = 50):
|
||||
workouts = []
|
||||
|
|
|
@ -114,7 +114,7 @@ def test_is_workout_present(fittrackee):
|
|||
status_code=200,
|
||||
)
|
||||
workout = fittrackee.is_workout_present()
|
||||
assert workout is False
|
||||
assert workout is True
|
||||
|
||||
|
||||
def test_is_workout_present_http_error(fittrackee):
|
||||
|
|
Loading…
Reference in a new issue