Exemplo n.º 1
0
def test_doneTask():
    tm = TaskManager()
    tm.exec("+ Acheter du pain")
    tm.exec("x 1")
    assert tm.tasks[0].status == "DONE"
Exemplo n.º 2
0
def test_toDoTask():
    tm = TaskManager()
    tm.exec("+ Acheter du pain")
    tm.exec("x 1")
    tm.exec("o 1")
    assert tm.tasks[0].status == "TODO"
Exemplo n.º 3
0
def parseEmptyInput():
    tm = TaskManager()
    tm.exec("")
    assert tm.action.type is None
Exemplo n.º 4
0
def test_saveOneTask():
    tm = TaskManager()
    tm.exec("+ Acheter du pain")
    assert tm.tasks[0].label == "Acheter du pain"
    assert tm.tasks[0].status == "TODO"
Exemplo n.º 5
0
def parseInputActionToDo():
    tm = TaskManager()
    tm.exec("+ Acheter du pain")
    tm.exec("o 1")
    assert tm.action.type == "TODO"
Exemplo n.º 6
0
def parseInputActionDone():
    tm = TaskManager()
    tm.exec("+ Acheter du pain")
    tm.exec("x 1")
    assert tm.action.type == "DONE"
Exemplo n.º 7
0
def parseInputActionRemove():
    tm = TaskManager()
    tm.exec("+ Acheter du pain")
    tm.exec("- 1")
    assert tm.action.type == "REMOVE"
Exemplo n.º 8
0
def parseInputActionAdd():
    tm = TaskManager()
    tm.exec("+ Acheter du pain")
    assert tm.action.type == "ADD"
Exemplo n.º 9
0
from TaskManager import TaskManager
from os import system, name

def clear():
    # for windows
    if name == 'nt':
        _ = system('cls')
        # for mac and linux(here, os.name is 'posix')
    else:
        _ = system('clear')

tm = TaskManager()

while True:
    clear()
    print("Listes:")
    tm.displayTasks()
    tm.exec(input("commande: "))