mirror of
https://github.com/sstent/go-garth.git
synced 2026-01-27 17:41:57 +00:00
working auth and activity list
This commit is contained in:
24
garth/tests/stats/test_steps.py
Normal file
24
garth/tests/stats/test_steps.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from datetime import date, timedelta
|
||||
|
||||
import pytest
|
||||
|
||||
from garth import DailySteps, WeeklySteps
|
||||
from garth.http import Client
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
def test_daily_steps(authed_client: Client):
|
||||
end = date(2023, 7, 20)
|
||||
days = 20
|
||||
daily_steps = DailySteps.list(end, days, client=authed_client)
|
||||
assert daily_steps[-1].calendar_date == end
|
||||
assert len(daily_steps) == days
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
def test_weekly_steps(authed_client: Client):
|
||||
end = date(2023, 7, 20)
|
||||
weeks = 52
|
||||
weekly_steps = WeeklySteps.list(end, weeks, client=authed_client)
|
||||
assert len(weekly_steps) == weeks
|
||||
assert weekly_steps[-1].calendar_date == end - timedelta(days=6)
|
||||
Reference in New Issue
Block a user