Skip to content

Commit

Permalink
🐛 improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
yezz123 committed Jul 1, 2023
1 parent 37fc108 commit ef063e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/internal/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ def test_months_after(sample_datetime):
assert months_after(sample_datetime, months=1) == expected_result


def test_years_ago(sample_datetime):
def test_years_ago():
dt = datetime(2023, 5, 20, 12, 0, 0)
expected_result = datetime(2022, 5, 20, 12, 0, 0)
assert years_ago(sample_datetime, years=1) == expected_result
assert years_ago(dt, years=1) == expected_result


def test_days_after(sample_datetime):
Expand Down Expand Up @@ -160,17 +161,17 @@ def test_tz_from_iso():

def test_start_of_week():
dt = datetime(2023, 5, 20, 12, 0, 0)
expected_result = datetime(2023, 5, 15, 12, 0, 0)
expected_result = datetime(2023, 5, 14, 0, 0, 0)
assert start_of_week(dt) == expected_result


def test_end_of_week():
dt = datetime(2023, 5, 20, 12, 0, 0)
expected_result = datetime(2023, 5, 21, 12, 0)
expected_result = datetime(2023, 5, 20, 23, 59, 59, 999999)
assert end_of_week(dt) == expected_result


def test_end_of_last_week():
dt = datetime(2023, 5, 20, 12, 0, 0)
expected_result = datetime(2023, 5, 14, 12, 0)
expected_result = datetime(2023, 5, 13, 23, 59, 59, 999999)
assert end_of_last_week(dt) == expected_result

0 comments on commit ef063e6

Please sign in to comment.