From fc8752a996adf8fb2494637398a572d2e07e1de4 Mon Sep 17 00:00:00 2001 From: Johannes Alneberg Date: Thu, 13 Jun 2024 10:35:16 +0200 Subject: [PATCH 1/3] Capital F in finished --- daily_read/daily_report.py | 8 ++++---- tests/conftest.py | 4 ++-- tests/test_daily_report.py | 2 +- tests/test_order_portal.py | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/daily_read/daily_report.py b/daily_read/daily_report.py index aa5f09c..668ef39 100644 --- a/daily_read/daily_report.py +++ b/daily_read/daily_report.py @@ -17,16 +17,16 @@ STATUS_ICONS = { "All Raw data Delivered": "cloud-download", "All Samples Sequenced": "body-text", - "Library QC finished": "check2-all", - "Reception Control finished": "check2", + "Library QC Finished": "check2-all", + "Reception Control Finished": "check2", "Samples Received": "box-seam", } STATUS_DESCRIPTIONS = { "All Raw data Delivered": "The data has been made available through NGIs delivery system.", "All Samples Sequenced": "Sequencing (including potential resequencing) of all samples has been finished.", - "Library QC finished": "Library QC is a quality control of the sequencing library produced either by NGI or supplied by you, depending on the type of project.", - "Reception Control finished": "Reception Control consists of NGI staff measuring e.g. concentration and volume for the samples received.", + "Library QC Finished": "Library QC is a quality control of the sequencing library produced either by NGI or supplied by you, depending on the type of project.", + "Reception Control Finished": "Reception Control consists of NGI staff measuring e.g. concentration and volume for the samples received.", "Samples Received": "The samples have been received and registered at NGI.", "Pending": "The order has been set up but the samples have not yet been received or registered by NGI.", } diff --git a/tests/conftest.py b/tests/conftest.py index 22822c0..dd9246c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,7 +13,7 @@ "orderer": "dummy@dummy.se", "project_dates": { "2023-06-15": ["Samples Received"], - "2023-06-28": ["Reception Control finished", "Library QC finished"], + "2023-06-28": ["Reception Control Finished", "Library QC Finished"], }, "internal_id": "P123456", "internal_name": "D.Dummysson_23_01", @@ -24,7 +24,7 @@ "orderer": "dummy@dummy.se", "project_dates": { "2023-06-15": ["Samples Received"], - "2023-06-28": ["Reception Control finished", "Library QC finished"], + "2023-06-28": ["Reception Control Finished", "Library QC Finished"], "2023-07-28": ["All Samples Sequenced"], "2023-07-29": ["All Raw data Delivered"], }, diff --git a/tests/test_daily_report.py b/tests/test_daily_report.py index 0c741a1..c57b92e 100644 --- a/tests/test_daily_report.py +++ b/tests/test_daily_report.py @@ -22,7 +22,7 @@ def test_write_report_to_out_dir(data_repo_full, mock_project_data_record, creat assert op.all_orders[0]["identifier"] == order_id modified_orders = op.process_orders(config_values.STATUS_PRIORITY_REV) - assert modified_orders[orderer]["projects"]["Library QC finished"][0] == data_master.data[order_id] + assert modified_orders[orderer]["projects"]["Library QC Finished"][0] == data_master.data[order_id] pull_date = f"{datetime.datetime.strptime(modified_orders[orderer]['pull_date'], '%Y-%m-%d %H:%M:%S.%f').date()}" report_path = os.path.join(config_values.REPORTS_LOCATION, f"{orderer.split('@')[0]}_{pull_date}.html") diff --git a/tests/test_order_portal.py b/tests/test_order_portal.py index d77b202..e776cb9 100644 --- a/tests/test_order_portal.py +++ b/tests/test_order_portal.py @@ -22,11 +22,11 @@ def test_get_and_process_orders_open_upload_fail(data_repo_full, mock_project_da assert op.all_orders[0]["identifier"] == order_id modified_orders = op.process_orders(config_values.STATUS_PRIORITY_REV) - assert modified_orders[orderer]["projects"]["Library QC finished"][0] == data_master.data[order_id] + assert modified_orders[orderer]["projects"]["Library QC Finished"][0] == data_master.data[order_id] with mock.patch("daily_read.order_portal.requests.post") as mock_post: mock_post.return_value.status_code = 404 uploaded = op.upload_report_to_order_portal( - "test data", modified_orders[orderer]["projects"]["Library QC finished"][0], "published" + "test data", modified_orders[orderer]["projects"]["Library QC Finished"][0], "published" ) assert not uploaded assert f"Report not updated for order with project id: {order_id}\nReason: 404" in caplog.text @@ -47,11 +47,11 @@ def test_get_and_process_orders_open_and_upload(data_repo_full, mock_project_dat assert op.all_orders[0]["identifier"] == order_id modified_orders = op.process_orders(config_values.STATUS_PRIORITY_REV) - assert modified_orders[orderer]["projects"]["Library QC finished"][0] == data_master.data[order_id] + assert modified_orders[orderer]["projects"]["Library QC Finished"][0] == data_master.data[order_id] with mock.patch("daily_read.order_portal.requests.post") as mock_post: mock_post.return_value.status_code = 200 op.upload_report_to_order_portal( - "test data", modified_orders[orderer]["projects"]["Library QC finished"][0], "published" + "test data", modified_orders[orderer]["projects"]["Library QC Finished"][0], "published" ) url = f"{config_values.ORDER_PORTAL_URL}/api/v1/report" indata = dict( @@ -86,12 +86,12 @@ def test_get_and_process_orders_open_with_report_and_upload( assert op.all_orders[3]["identifier"] == order_id modified_orders = op.process_orders(config_values.STATUS_PRIORITY_REV) - assert modified_orders[orderer]["projects"]["Library QC finished"][0] == data_master.data[order_id] + assert modified_orders[orderer]["projects"]["Library QC Finished"][0] == data_master.data[order_id] with mock.patch("daily_read.order_portal.requests.post") as mock_post: mock_post.return_value.status_code = 200 with caplog.at_level(logging.INFO): uploaded = op.upload_report_to_order_portal( - "test data", modified_orders[orderer]["projects"]["Library QC finished"][0], "published" + "test data", modified_orders[orderer]["projects"]["Library QC Finished"][0], "published" ) url = f"{config_values.ORDER_PORTAL_URL}/api/v1/report/{op.all_orders[3]['reports'][0]['iuid']}" indata = dict( @@ -129,11 +129,11 @@ def test_get_and_process_orders_open_to_aborted_with_report_and_upload( assert op.all_orders[4]["identifier"] == order_id modified_orders = op.process_orders(config_values.STATUS_PRIORITY_REV) - assert modified_orders[orderer]["delete_report_for"]["Library QC finished"][0] == data_master.data[order_id] + assert modified_orders[orderer]["delete_report_for"]["Library QC Finished"][0] == data_master.data[order_id] with mock.patch("daily_read.order_portal.requests.post") as mock_post: mock_post.return_value.status_code = 200 op.upload_report_to_order_portal( - "", modified_orders[orderer]["delete_report_for"]["Library QC finished"][0], "review" + "", modified_orders[orderer]["delete_report_for"]["Library QC Finished"][0], "review" ) url = f"{config_values.ORDER_PORTAL_URL}/api/v1/report/{op.all_orders[4]['reports'][0]['iuid']}" indata = dict( From d08425e27f2c232fcf067f575ed6aa1cf6ddfe52 Mon Sep 17 00:00:00 2001 From: Johannes Alneberg Date: Thu, 13 Jun 2024 10:49:04 +0200 Subject: [PATCH 2/3] Forgot to save one file --- daily_read/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daily_read/config.py b/daily_read/config.py index 48f0c17..af9354d 100644 --- a/daily_read/config.py +++ b/daily_read/config.py @@ -22,8 +22,8 @@ def __init__(self, env_file_path): self.STATUS_PRIORITY = { 0: "Pending", 1: "Samples Received", - 2: "Reception Control finished", - 3: "Library QC finished", + 2: "Reception Control Finished", + 3: "Library QC Finished", 4: "All Samples Sequenced", 5: "All Raw data Delivered", } From 91c0f3239198238a615a25b17189fcae307bfbd6 Mon Sep 17 00:00:00 2001 From: Johannes Alneberg Date: Thu, 13 Jun 2024 10:50:53 +0200 Subject: [PATCH 3/3] Change the data to Data as well --- daily_read/config.py | 2 +- daily_read/daily_report.py | 4 ++-- tests/conftest.py | 2 +- tests/test_order_portal.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/daily_read/config.py b/daily_read/config.py index af9354d..d1c8c05 100644 --- a/daily_read/config.py +++ b/daily_read/config.py @@ -25,6 +25,6 @@ def __init__(self, env_file_path): 2: "Reception Control Finished", 3: "Library QC Finished", 4: "All Samples Sequenced", - 5: "All Raw data Delivered", + 5: "All Raw Data Delivered", } self.STATUS_PRIORITY_REV = {v: k for k, v in self.STATUS_PRIORITY.items()} diff --git a/daily_read/daily_report.py b/daily_read/daily_report.py index 668ef39..6955391 100644 --- a/daily_read/daily_report.py +++ b/daily_read/daily_report.py @@ -15,7 +15,7 @@ STATUS_ICONS = { - "All Raw data Delivered": "cloud-download", + "All Raw Data Delivered": "cloud-download", "All Samples Sequenced": "body-text", "Library QC Finished": "check2-all", "Reception Control Finished": "check2", @@ -23,7 +23,7 @@ } STATUS_DESCRIPTIONS = { - "All Raw data Delivered": "The data has been made available through NGIs delivery system.", + "All Raw Data Delivered": "The data has been made available through NGIs delivery system.", "All Samples Sequenced": "Sequencing (including potential resequencing) of all samples has been finished.", "Library QC Finished": "Library QC is a quality control of the sequencing library produced either by NGI or supplied by you, depending on the type of project.", "Reception Control Finished": "Reception Control consists of NGI staff measuring e.g. concentration and volume for the samples received.", diff --git a/tests/conftest.py b/tests/conftest.py index dd9246c..bf6b7b5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,7 +26,7 @@ "2023-06-15": ["Samples Received"], "2023-06-28": ["Reception Control Finished", "Library QC Finished"], "2023-07-28": ["All Samples Sequenced"], - "2023-07-29": ["All Raw data Delivered"], + "2023-07-29": ["All Raw Data Delivered"], }, "internal_id": "P123455", "internal_name": "D.Dummysson_23_02", diff --git a/tests/test_order_portal.py b/tests/test_order_portal.py index e776cb9..14cc3b3 100644 --- a/tests/test_order_portal.py +++ b/tests/test_order_portal.py @@ -161,7 +161,7 @@ def test_get_and_process_orders_closed(data_repo_full, mock_project_data_record, assert op.all_orders[1]["identifier"] == order_id modified_orders = op.process_orders(config_values.STATUS_PRIORITY_REV) - assert modified_orders[orderer]["delete_report_for"]["All Raw data Delivered"][0] == data_master.data[order_id] + assert modified_orders[orderer]["delete_report_for"]["All Raw Data Delivered"][0] == data_master.data[order_id] def test_get_and_process_orders_mult_reports(data_repo_full, mock_project_data_record, get_env_file_path):