Beispiel #1
0
def test_modify_status(status):
    '''
    Test each aspect of modify_status
    '''
    # Refuse to modify a non existant status
    assert not user_status.modify_status(*status)
    user_status.add_status(*status)
    # Sucessfully modify a status
    assert user_status.modify_status(*status)
Beispiel #2
0
def test_modify_status(db):
    assert users.add_user(
        ("test1", "*****@*****.**", "tester", "one"), db) is True
    assert user_status.add_status(
        ["test1_status_id", "test1", "test status text"], db) is True
    assert user_status.modify_status("test1_status_id", "test1",
                                     "new status text", db) is True
    assert user_status.modify_status("status_id_not_in_db", "test1",
                                     "some status", db) is False
    assert user_status.modify_status("status_id_not_in_db", "baduserid",
                                     "some status", db) is False
Beispiel #3
0
def update_status(status_id, user_id, status_text, db):
    '''
    Requirements:
    - Returns False if there any errors.
    - Otherwise, it returns True.
    '''
    return user_status.modify_status(status_id, user_id, status_text, db)
Beispiel #4
0
def update_status(status_id, user_id, status_text):
    '''
    Updates the values of an existing status_id

    Requirements:
    - Returns False if there any errors.
    - Otherwise, it returns True.
    '''
    logger.info('Updating a Status')
    return user_status.modify_status(status_id, user_id, status_text)