Exemple #1
0
def test_get_users__page_returned(client):
    # Arrange
    wserver = WebServer('sqlite://')
    gui.serverInst = wserver

    # Act
    res = client.get('/users')

    # Assert
    assert res is not None
    assert res._status_code == 200
    assert res.data is not None
Exemple #2
0
def test_get_user__user_doesnt_exist__404_returned(client):
    # Arrange
    wserver = WebServer('sqlite://')
    gui.serverInst = wserver
    saver = Saver('sqlite://')
    saver.engine = wserver.reader.engine
    saved_msg = fill_db(saver)

    # Act
    res = client.get(f'/users/9988')

    # Assert
    assert res is not None
    assert res._status_code == 404
Exemple #3
0
def test_get_home__page_returned(client):
    # Arrange
    wserver = WebServer('sqlite://')
    gui.serverInst = wserver
    # saver =  Saver('sqlite://')
    # saver.engine = wserver.reader.engine
    # fill_db(saver)

    # Act
    res = client.get('/')

    # Assert
    assert res is not None
    assert res._status_code == 200
    assert res.data is not None
Exemple #4
0
def test_get_result_data__result_doesnt_exist__404_returned(client):
    # Arrange
    wserver = WebServer('sqlite://')
    gui.serverInst = wserver
    saver = Saver('sqlite://')
    saver.engine = wserver.reader.engine
    saved_msg = fill_db(saver)
    uid = str(saved_msg['user_info']['uid'])
    snap_id = 1

    # Act
    res = client.get(f'/users/{uid}/snapshots/{snap_id}/pose/data')

    # Assert
    assert res is not None
    assert res._status_code == 404
Exemple #5
0
def test_get_timeline_data__user_exist__page_returned(client):
    # Arrange
    wserver = WebServer('sqlite://')
    gui.serverInst = wserver
    saver = Saver('sqlite://')
    saver.engine = wserver.reader.engine
    saved_msg = fill_db(saver)
    uid = str(saved_msg['user_info']['uid'])
    snap_id = 1

    # Act
    res = client.get(f'/users/{uid}/timeline_data.html')

    # Assert
    assert res is not None
    assert res._status_code == 200
Exemple #6
0
def test_get_users__page_returned(client):
    # Arrange
    wserver = WebServer('sqlite://')
    gui.serverInst = wserver
    saver = Saver('sqlite://')
    saver.engine = wserver.reader.engine
    saved_msg = fill_db(saver)

    # Act
    res = client.get('/users')

    # Assert
    assert res is not None
    assert res._status_code == 200
    assert res.data is not None
    assert str(saved_msg['user_info']['uid']) in str(res.data)
    assert str(saved_msg['user_info']['name']) in str(res.data)