diff options
author | Frederick Muriuki Muriithi | 2024-10-17 10:26:15 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-10-17 11:32:28 -0500 |
commit | 85215361b561d332cab954ea68438a2d442c96d8 (patch) | |
tree | 90a3115843770f5e3806762695223a7115a71d99 /tests/qc_app/test_results_page.py | |
parent | 9db2d0986619bf801e2308ee55e4340d9f050376 (diff) | |
download | gn-uploader-85215361b561d332cab954ea68438a2d442c96d8.tar.gz |
Rename test module.
Diffstat (limited to 'tests/qc_app/test_results_page.py')
-rw-r--r-- | tests/qc_app/test_results_page.py | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/qc_app/test_results_page.py b/tests/qc_app/test_results_page.py deleted file mode 100644 index 8c8379f..0000000 --- a/tests/qc_app/test_results_page.py +++ /dev/null @@ -1,68 +0,0 @@ -"Test results page" - -def test_results_with_stderr_output( - client, job_id, stderr_with_output, # pylint: disable=[unused-argument] - redis_conn_with_in_progress_job_no_errors): # pylint: disable=[unused-argument] - """ - GIVEN: 1. A flask application testing client - 2. A file with content to simulate the stderr output - 3. A sample job to prevent the "No such job" error message - WHEN: The parsing progress page is loaded for a non existing job - THEN: Ensure that the page: - 1. Redirects to a job failure display page - 2. The job failure display page: - a) indicates that this is a worker failure - b) provides some debugging information - """ - # Maybe get rid of the use of a stderr file, and check for actual exceptions - resp = client.get(f"/parse/status/{job_id}", follow_redirects=True) - assert len(resp.history) == 1 - assert b'<h1 class="heading">Worker Failure</h1>' in resp.data - assert b'<h4>Debugging Information</h4>' in resp.data - assert ( - f"<li><strong>job id</strong>: {job_id}</li>".encode("utf8") - in resp.data) - -def test_results_with_completed_job_no_errors( - client, job_id, stderr_with_no_output, # pylint: disable=[unused-argument] - redis_conn_with_completed_job_no_errors): # pylint: disable=[unused-argument] - """ - GIVEN: 1. A flask application testing client - 2. A redis instance with a completed job, with no errors found in - the file - 3. A file with no contents to simulate no stderr output - WHEN: The parsing progress page is loaded - THEN: Ensure that: - 1. the system redirects to the results page - 2. the results page indicates that there are no errors in the file - being processed - """ - resp = client.get(f"/parse/status/{job_id}", follow_redirects=True) - assert len(resp.history) == 1 - assert ( - b'<span class="alert-success">No errors found in the file</span>' - in resp.data) - -def test_results_with_completed_job_some_errors( - client, job_id, stderr_with_no_output, # pylint: disable=[unused-argument] - redis_conn_with_completed_job_some_errors): # pylint: disable=[unused-argument] - """ - GIVEN: 1. A flask application testing client - 2. A redis instance with a completed job, with some errors found in - the file - 3. A file with no contents to simulate no stderr output - WHEN: The parsing progress page is loaded - THEN: Ensure that: - 1. the system redirects to the results page - 2. the results page displays the errors found - """ - resp = client.get(f"/parse/status/{job_id}", follow_redirects=True) - assert len(resp.history) == 1 - assert ( - b'<p class="alert-danger">We found the following errors</p>' - in resp.data) - assert b'<table class="table reports-table">' in resp.data - assert b'Duplicate Header' in resp.data - assert b'<td>Heading 'DupHead' is repeated</td>' in resp.data - assert b'Invalid Value' in resp.data - assert b'<td>Invalid value 'ohMy'</td>' in resp.data |