コード例 #1
0
def test_edit_todo():
    todo.todos = [
        {
            'title': 'make some stuff',
            'description': 'This is an important test',
            'level': 'IMPORTANT'
        }
    ]
    # Edit this todo item
    response = todo.edit_todo(todo.todos, which="1", title="", description="Stuff needs to be programmed prperly", level="")

    assert response == "Edited todo #1", response
    assert todo.todos[0]['title'] == "make some stuff"
    assert todo.todos[0]['description'] == "Stuff needs to be programmed prperly"
    assert todo.todos[0]['level'] == "IMPORTANT"

    print "OK - edit todo"
コード例 #2
0
def test_edit_importance():
    todo.todos = [
        {
            'title': 'djkajs owjo',
            'description': 'This is an medium test',
            'level': 'Medium'
        },
        {
            'title': 'Test another medium todo',
            'description': 'This is another medium test',
            'level': 'Medium'
        }
    ]
    # Edit the second todo item's importance
    response = todo.edit_todo(todo.todos, which="2", title="", description="", level="Important")

    assert todo.todos[0]['level'] == "IMPORTANT"
    assert todo.todos[1]['level'] == "Medium"

    print "OK - edit importance"
コード例 #3
0
def test_edit_importance():
    todo.todos = [
        { 'title' : 'test medium todo',
          'description' : 'This is a medium todo',
          'level' : 'medium'
        },
        { 'title' : 'test another medium todo',
          'description' : 'This is another medium todo',
          'level' : 'medium'
        },
    ]
    
    response = todo.edit_todo(todo.todos,
        which="2",
        title="",
        description="",
        level="Important")

    assert todo.todos[0]['level'] == "IMPORTANT"
    assert todo.todos[1]['level'] == "medium"
    
    print "ok - edit importance"
コード例 #4
0
def test_edit_todo():
    todo.todos = [
        { 'title' : "Make some stuff",
          'description' : 'This is an important test',
          'level' : 'IMPORTANT'
        },
    ]
    
    response = todo.edit_todo(todo.todos,
        which="1",
        title="",
        description="Stuff needs to be programmed properly",
        level="")

    assert response == "Edited todo", response
    assert len(todo.todos) == 1
    assert todo.todos[0]['title'] == "Make some stuff"
    assert (todo.todos[0]['description'] ==
            "Stuff needs to be programmed properly")
    assert todo.todos[0]['level'] == "IMPORTANT"

    print "ok - edit todo"
コード例 #5
0
ファイル: test_todo.py プロジェクト: shifteight/python
def test_edit_todo():
    todo.todos = [
        {
            'title': "Make some stuff",
            'description': 'This is an important test',
            'level': 'IMPORTANT'
        },
    ]

    response = todo.edit_todo(todo.todos,
                              which='1',
                              title='',
                              description='Stuff needs to be programmed properly',
                              level='')

    assert response == 'Edited todo #1', response
    assert len(todo.todos) == 1
    assert todo.todos[0]['title'] == "Make some stuff"
    assert todo.todos[0]['description'] == 'Stuff needs to be programmed properly'
    assert todo.todos[0]['level'] == 'IMPORTANT'

    print "ok - edit todo"
コード例 #6
0
ファイル: test_todo.py プロジェクト: shifteight/python
def test_edit_importance():
    todo.todos = [
        {
            'title': "test medium todo",
            'description': 'This is a medium todo',
            'level': 'medium'
        },
        {
            'title': "test another medium todo",
            'description': 'This is another medium todo',
            'level': 'medium'
        },
    ]

    response = todo.edit_todo(todo.todos,
                              which='2',
                              title='',
                              description='',
                              level='Important')

    assert todo.todos[0]['level'] == 'IMPORTANT'
    assert todo.todos[1]['level'] == 'medium'

    print "ok - edit importance"
コード例 #7
0
ファイル: test_todo.py プロジェクト: Carlosperez1001/python
def test_edit_importance():
    todo.todos = [
        {
            'title': "test medium todo",
            'description': 'This is a medium todo',
            'level': 'medium'
        },
        {
            'title': "test another medium todo",
            'description': 'This is another medium todo',
            'level': 'medium'
        },
    ]

    response = todo.edit_todo(todo.todos,
                              which='2',
                              title='',
                              description='',
                              level='Important')

    assert todo.todos[0]['level'] == 'IMPORTANT'
    assert todo.todos[1]['level'] == 'medium'

    print "ok - edit importance"
コード例 #8
0
ファイル: test_todo.py プロジェクト: Carlosperez1001/python
def test_edit_todo():
    todo.todos = [
        {
            'title': "Make some stuff",
            'description': 'This is an important test',
            'level': 'IMPORTANT'
        },
    ]

    response = todo.edit_todo(
        todo.todos,
        which='1',
        title='',
        description='Stuff needs to be programmed properly',
        level='')

    assert response == 'Edited todo #1', response
    assert len(todo.todos) == 1
    assert todo.todos[0]['title'] == "Make some stuff"
    assert todo.todos[0][
        'description'] == 'Stuff needs to be programmed properly'
    assert todo.todos[0]['level'] == 'IMPORTANT'

    print "ok - edit todo"