diff --git a/daily_read/config.py b/daily_read/config.py index 48f0c17..d1c8c05 100644 --- a/daily_read/config.py +++ b/daily_read/config.py @@ -22,9 +22,9 @@ 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", + 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 aa5f09c..6955391 100644 --- a/daily_read/daily_report.py +++ b/daily_read/daily_report.py @@ -15,18 +15,18 @@ 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", + "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 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..bf6b7b5 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,9 +24,9 @@ "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"], + "2023-07-29": ["All Raw Data Delivered"], }, "internal_id": "P123455", "internal_name": "D.Dummysson_23_02", 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..14cc3b3 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( @@ -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):