Skip to content

Commit ebd21db

Browse files
committed
Added Goal to_dict and Toal from_dict tests for test_wave_05
1 parent 61ca14b commit ebd21db

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/test_wave_05.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
1+
from app.models.goal import Goal
12
import pytest
23

4+
@pytest.mark.skip(reason="No way to test this feature yet")
5+
def test_goal_to_dict():
6+
#Arrange
7+
new_goal = Goal(title="Seize the Day!")
8+
9+
#Act
10+
goal_dict = new_goal.to_dict()
11+
12+
#Assert
13+
assert goal_dict == {
14+
"id": None,
15+
"title": "Seize the Day!"
16+
}
17+
18+
@pytest.mark.skip(reason="No way to test this feature yet")
19+
def test_goal_from_dict():
20+
#Arrange
21+
goal_dict = {
22+
"title": "Seize the Day!",
23+
}
24+
25+
expected_goal = Goal(title="Seize the Day!")
26+
27+
#Act
28+
goal_obj = Goal.from_dict(goal_dict)
29+
30+
#Assert
31+
assert goal_obj.id is None
32+
assert goal_obj.title == expected_goal.title
333

434
@pytest.mark.skip(reason="No way to test this feature yet")
535
def test_get_goals_no_saved_goals(client):

0 commit comments

Comments
 (0)