Skip to content

Commit

Permalink
chore(tests): simplify period tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yannforget committed Aug 8, 2023
1 parent e2589a1 commit 140879d
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions tests/dhis2/test_periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
def test_day():
d1 = Day("20220101")
d2 = Day(datetime(2022, 1, 1))
<<<<<<< HEAD
assert d1 == d2
=======
assert d1.period == d2.period
>>>>>>> 549c06d (chore(tests): add tests for dhis2 periods)

with pytest.raises(ValueError):
Day("2022-01-01")
Expand All @@ -31,11 +27,7 @@ def test_day_range():
def test_week():
w1 = Week("2022W4")
w2 = Week(datetime(2022, 1, 25))
<<<<<<< HEAD
assert w1 == w2
=======
assert w1.period == w2.period
>>>>>>> 549c06d (chore(tests): add tests for dhis2 periods)

with pytest.raises(ValueError):
Week("2022W04")
Expand All @@ -51,11 +43,7 @@ def test_week_range():
def test_month():
m1 = Month("202201")
m2 = Month(datetime(2022, 1, 1))
<<<<<<< HEAD
assert m1 == m2
=======
assert m1.period == m2.period
>>>>>>> 549c06d (chore(tests): add tests for dhis2 periods)

with pytest.raises(ValueError):
Month("2022-01")
Expand All @@ -71,11 +59,7 @@ def test_month_range():
def test_year():
y1 = Year("2022")
y2 = Year(datetime(2022, 1, 1))
<<<<<<< HEAD
assert y1 == y2
=======
assert y1.period == y2.period
>>>>>>> 549c06d (chore(tests): add tests for dhis2 periods)


def test_year_range():
Expand All @@ -88,11 +72,7 @@ def test_year_range():
def test_quarter():
q1 = Quarter("2021Q4")
q2 = Quarter(datetime(2021, 12, 1))
<<<<<<< HEAD
assert q1 == q2
=======
assert q1.period == q2.period
>>>>>>> 549c06d (chore(tests): add tests for dhis2 periods)


def test_quarter_range():
Expand All @@ -105,11 +85,7 @@ def test_quarter_range():
def test_six_month():
sm1 = SixMonth("2022S2")
sm2 = SixMonth(datetime(2022, 12, 1))
<<<<<<< HEAD
assert sm1 == sm2
=======
assert sm1.period == sm2.period
>>>>>>> 549c06d (chore(tests): add tests for dhis2 periods)


def test_six_month_range():
Expand All @@ -122,7 +98,6 @@ def test_six_month_range():
def test_period_from_string():
p1 = period_from_string("20220101")
p2 = Day("20220101")
<<<<<<< HEAD
assert p1 == p2

p1 = period_from_string("202201")
Expand All @@ -144,26 +119,3 @@ def test_period_from_string():
p1 = period_from_string("2022S1")
p2 = SixMonth("2022S1")
assert p1 == p2
=======
assert p1.period == p2.period

p1 = period_from_string("202201")
p2 = Month("202201")
assert p1.period == p2.period

p1 = period_from_string("2022W1")
p2 = Week("2022W1")
assert p1.period == p2.period

p1 = period_from_string("2022")
p2 = Year("2022")
assert p1.period == p2.period

p1 = period_from_string("2022Q1")
p2 = Quarter("2022Q1")
assert p1.period == p2.period

p1 = period_from_string("2022S1")
p2 = SixMonth("2022S1")
assert p1.period == p2.period
>>>>>>> 549c06d (chore(tests): add tests for dhis2 periods)

0 comments on commit 140879d

Please sign in to comment.