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
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
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
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)