Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/test/acceptance/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from http import HTTPStatus
from pathlib import Path

import pytest
Expand Down Expand Up @@ -91,5 +92,5 @@ def upload_test_firmware(test_client, test_fw):
}
rv = test_client.post('/upload', content_type='multipart/form-data', data=data, follow_redirects=True)

assert b'Upload Successful' in rv.data, 'upload not successful'
assert rv.status_code == HTTPStatus.OK, 'upload not successful'
assert test_fw.uid.encode() in rv.data, 'uid not found on upload success page'
3 changes: 2 additions & 1 deletion src/test/acceptance/test_misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from http import HTTPStatus
from urllib.parse import quote

import pytest
Expand Down Expand Up @@ -44,7 +45,7 @@ def _upload_firmware_put(self, test_client, path, device_name, uid):
'analysis_systems': [],
}
rv = test_client.post('/upload', content_type='multipart/form-data', data=data, follow_redirects=True)
assert b'Upload Successful' in rv.data, 'upload not successful'
assert rv.status_code == HTTPStatus.OK, 'upload not successful'
assert uid.encode() in rv.data, 'uid not found on upload success page'

def _show_stats(self, test_client):
Expand Down
3 changes: 2 additions & 1 deletion src/test/unit/web_interface/test_app_re_analyze.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
from http import HTTPStatus

from helperFunctions.data_conversion import make_bytes
from test.common_helper import TEST_FW
Expand Down Expand Up @@ -35,7 +36,7 @@ def test_app_re_analyze_post_valid(self, test_client, intercom_task_list):
'analysis_systems': ['new_system'],
}
rv = test_client.post(f'/update-analysis/{TEST_FW.uid}', data=form_data)
assert b'Upload Successful' in rv.data
assert rv.status_code == HTTPStatus.OK, 'upload not successful'
assert make_bytes(TEST_FW.uid) in rv.data
assert intercom_task_list[0].uid == TEST_FW.uid, 'fw not added to intercom'
assert 'new_system' in intercom_task_list[0].scheduled_analysis, 'new analysis system not scheduled'
3 changes: 2 additions & 1 deletion src/test/unit/web_interface/test_app_upload.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
from http import HTTPStatus
from io import BytesIO


Expand Down Expand Up @@ -46,7 +47,7 @@ def test_app_upload_valid_firmware(self, test_client, intercom_task_list):
},
follow_redirects=True,
)
assert b'Upload Successful' in rv.data
assert rv.status_code == HTTPStatus.OK, 'upload not successful'
assert b'c1f95369a99b765e93c335067e77a7d91af3076d2d3d64aacd04e1e0a810b3ed_17' in rv.data
assert (
intercom_task_list[0].uid == 'c1f95369a99b765e93c335067e77a7d91af3076d2d3d64aacd04e1e0a810b3ed_17'
Expand Down
2 changes: 1 addition & 1 deletion src/web_interface/components/analysis_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def post_update_analysis(self, uid, re_do=False):
raise
force_reanalysis = request.form.get('force_reanalysis') == 'true'
self._schedule_re_analysis_task(uid, analysis_task, re_do, force_reanalysis)
return render_template('upload/upload_successful.html', uid=uid)
return uid

def _schedule_re_analysis_task(self, uid, analysis_task, re_do, force_reanalysis=False):
if re_do:
Expand Down
2 changes: 1 addition & 1 deletion src/web_interface/components/io_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def post_upload(self):
raise
fw = convert_analysis_task_to_fw_obj(analysis_task)
self.intercom.add_analysis_task(fw)
return render_template('upload/upload_successful.html', uid=analysis_task['uid'])
return analysis_task['uid']

@roles_accepted(*PRIVILEGES['submit_analysis'])
@AppRoute('/upload', GET)
Expand Down
Loading