Skip to content

Commit

Permalink
ugh another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
voynow committed Feb 2, 2025
1 parent b1558b6 commit b271abd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
6 changes: 4 additions & 2 deletions api/src/update_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ async def refresh_user_data(
user=user,
daily_activity=daily_activity,
mileage_rec=mileage_rec,
exe_type=ExeType.MID_WEEK,
dt=dt_tomorrow,
exe_type=(
ExeType.NEW_WEEK if dt.weekday() == 6 else ExeType.MID_WEEK
), # step into next week on sundays
dt=dt,
)

supabase_client.upsert_training_week(
Expand Down
22 changes: 11 additions & 11 deletions api/tests/test_update_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ def setup_test_environment():
auth_manager.authenticate_athlete(os.environ["JAMIES_ATHLETE_ID"])


@pytest.mark.asyncio
async def test_refresh_user_data_on_sunday():
"""
Test successful refresh of user data
"""
delete_test_user_training_plans()
user = supabase_client.get_user(os.environ["TEST_USER_ATHLETE_ID"])
response = await refresh_user_data(user, dt=get_last_sunday())
assert isinstance(response, dict)


@pytest.mark.asyncio
async def test_update_training_week_gen_training_plan():
"""
Expand All @@ -46,17 +57,6 @@ async def test_update_training_week_mid_week():
assert isinstance(response, FullTrainingWeek)


@pytest.mark.asyncio
async def test_refresh_user_data_on_sunday():
"""
Test successful refresh of user data
"""
delete_test_user_training_plans()
user = supabase_client.get_user(os.environ["TEST_USER_ATHLETE_ID"])
response = await refresh_user_data(user, dt=get_last_sunday())
assert isinstance(response, dict)


@pytest.mark.asyncio
async def test_refresh_user_data_on_monday():
"""
Expand Down

0 comments on commit b271abd

Please sign in to comment.