def test_parse_del(): command = "- first task" numero = 1 task_manager = TaskManager() action = task_manager.parsedel(command, numero) assert action.name == "del" assert action.numero == 1
def test_parse_add(): command = "+ Fourth task" task_manager = TaskManager() action = task_manager.parse(command) assert action.name == "add" assert action.description == "Fourth task"
def test_parse_del(): command = "- numero" numero = 1 statut = "a faire" task_manager = TaskManager() action = task_manager.parse_del(command, numero, statut) assert action.numero == 1
def test_parse_statut_o(): command = "x numero" numero = 1 statut = "fait" task_manager = TaskManager() action = task_manager.parse_statut_o(command, numero, statut) assert action.numero == 1 assert action.statut == "fait"
def test_parse_add(): command = "+ first task" task_manager = TaskManager() numero = 1 action = task_manager.parseadd(command, numero) assert action.name == "add" assert action.description == "first task" assert action.numero == 1
def test_write_file_tasks(): fichier = open("liste_taches.txt", "w") task_manager = TaskManager() tache1 = task_manager.parse_add("", "", "") fichier.write(tache1.name) fichier.write(" ") fichier.write(tache1.numero) fichier.write(" ") fichier.write(tache1.statut) fichier.write(" ") fichier.close()
def test_parse_add(): command = "+ first task" numero = 1 statut = "a faire" task_manager = TaskManager() action = task_manager.parse_add(command,numero, statut) assert action.name == "add" assert action.description == "first task" assert action.statut == "a faire"
def test_parse_delete(): # Adding the task. command = "+ first task" task_manager = TaskManager() action = task_manager.parse(command) task_manager.parse_logic(action) task_added = task_manager.tasks[0] # Remove the task. command = "- first task" action = task_manager.parse(command) task_manager.parse_logic(action) # Check if task has been deleted. for _task in task_manager.tasks: if _task.id == task_added.id: AssertionError
def test_can_create_a_task_manager(): task_manager = TaskManager()
def test_task_manager_starts_with_tasks(): task_manager = TaskManager() assert task_manager.tasks == ["First task", "Second task", "Third task"]
def task_manager(tmp_path): sqlite_path = tmp_path / "tasks.db" return TaskManager(sqlite_path)
def test_repository(): task_manager = TaskManager() tache1 = task_manager.parse_add("tache1", "1", "A faire") tasks = [tache1] assert task_manager.tasks == []
def test_task_manager_starts_with_no_tasks(): task_manager = TaskManager() assert task_manager.tasks == []
def task_manager(): sqlite_path = Path("tests.db") task_manager = TaskManager(sqlite_path) task_manager.repository.clean() return task_manager