Esempio n. 1
0
def test_delete_not_existing_todo(repository: Repository) -> None:
    id_, text = _insert_todo(repository, "This is a Todo!")

    result = repository.delete(_random_id())
    assert not result

    todo = repository.get(id_)
    assert todo == Todo(id=id_, text=text, active=True)
Esempio n. 2
0
def test_edit_text_not_existing_todo(repository: Repository) -> None:
    id_, text = _insert_todo(repository, "This is a Todo!")

    result = repository.edit_text(_random_id(), "Hello World")
    assert not result

    todo = repository.get(id_)
    assert todo == Todo(id=id_, text=text, active=True)
Esempio n. 3
0
def test_get_existing_todo(repository: Repository) -> None:
    id_1, text_1 = _insert_todo(repository, "This is a Todo!")
    _insert_todo(repository, "This is a ANOTHER Todo!")

    todo = repository.get(id_1)
    assert todo == Todo(id=id_1, text=text_1, active=True)
Esempio n. 4
0
def test_get_not_existing_todo(repository: Repository) -> None:
    todo = repository.get(_random_id())
    assert todo is None