-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_finish.py
35 lines (27 loc) · 993 Bytes
/
test_finish.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pytest
from cards import Card
def test_finish_from_in_prog(cards_db):
index = cards_db.add_card(Card("second ed", state="in prog"))
cards_db.finish(index)
card = cards_db.get_card(index)
assert card.state == "done"
def test_finish_from_done(cards_db):
index = cards_db.add_card(Card("second ed", state="done"))
cards_db.finish(index)
card = cards_db.get_card(index)
assert card.state == "done"
def test_finish_from_todo(cards_db):
index = cards_db.add_card(Card("second ed", state="todo"))
cards_db.finish(index)
card = cards_db.get_card(index)
assert card.state == "done"
@pytest.mark.parametrize("summary, status", [
("write a book", "done"),
("second edition", "in prog"),
("create a course", "todo"),
])
def test_finish_from_status(summary, status, cards_db):
index = cards_db.add_card(Card(summary, state=status))
cards_db.finish(index)
card = cards_db.get_card(index)
assert card.state == "done"