コード例 #1
0
ファイル: test_gui.py プロジェクト: NeverBit/BrainStorm
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
コード例 #2
0
ファイル: test_gui.py プロジェクト: NeverBit/BrainStorm
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
コード例 #3
0
ファイル: test_gui.py プロジェクト: NeverBit/BrainStorm
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
コード例 #4
0
ファイル: test_gui.py プロジェクト: NeverBit/BrainStorm
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)