From 19b981620062c0ba7125028827fc702f1b1c2506 Mon Sep 17 00:00:00 2001 From: Hsin-Fang Chiang Date: Thu, 5 Dec 2024 14:35:04 -0800 Subject: [PATCH] Shift now timestamp and embargo period together for two tests test_raw_and_calexp_should_copy and test_raw_and_calexp_should_copy_yaml have two, different now_time_embargo timestamps. With the new API, it is more difficult to test with multiple now_time_embargo timestamps in one call. Also we wouldn't use that in pratical use case anyway. So, use just the later timestamp, and shift the embargo period for the raw datasets that used the earlier timestamp. The amount of shifting is the difference between the two original now_time_embargo timestamps: 2022-11-13T03:35:12.836981 - 2020-01-17T16:55:11.322700 = 89030401.514281 seconds, or 24730.66708730028 hr. Instead of an embargo period of 0.1 hr, the new embargo period is 0.1 + 24730.66708730028 hr. --- tests/test_move_embargo_args.py | 10 +++------- tests/yamls/config_all.yaml | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test_move_embargo_args.py b/tests/test_move_embargo_args.py index 86a90508..991080ec 100644 --- a/tests/test_move_embargo_args.py +++ b/tests/test_move_embargo_args.py @@ -307,15 +307,13 @@ def tearDown(self): # potentially we won't need to test this in the future # @KT - we were not planning on running multiple args from # cli - @unittest.expectedFailure def test_raw_and_calexp_should_copy(self): """ Test that move_embargo_args runs for the calexp datatype and for the raw datatype at the same time """ # first raw, then calexp - # TODO: why two now timestamps? - now_time_embargo = ["2020-01-17T16:55:11.322700", "2022-11-13T03:35:12.836981"] + now_time_embargo = "2022-11-13T03:35:12.836981" # IDs that should be moved to temp_to: ids_copied = [ # 2020011700004, @@ -348,7 +346,7 @@ def test_raw_and_calexp_should_copy(self): "dataset_types": "raw", "collections": "LATISS/raw/all", "where": "instrument='LATISS'", - "embargo_hours": 0.1, + "embargo_hours": 24730.76708730028, "is_raw": True, }, { @@ -541,15 +539,13 @@ def test_calexp_should_copy(self): # desturiprefix="tests/data/", ) - @unittest.expectedFailure def test_raw_and_calexp_should_copy_yaml(self): """ Test that move_embargo_args runs for the calexp datatype and for the raw datatype at the same time """ # first raw, then calexp - # TODO: why two now timestamps? - now_time_embargo = ["2020-01-17T16:55:11.322700", "2022-11-13T03:35:12.836981"] + now_time_embargo = "2022-11-13T03:35:12.836981" # IDs that should be moved to temp_to: ids_copied = [ # 2020011700004, diff --git a/tests/yamls/config_all.yaml b/tests/yamls/config_all.yaml index c57d43e2..0ba10434 100644 --- a/tests/yamls/config_all.yaml +++ b/tests/yamls/config_all.yaml @@ -2,7 +2,7 @@ - dataset_types: "raw" collections: "LATISS/raw/all" where: "instrument='LATISS'" - embargo_hours: 0.1 + embargo_hours: 24730.76708730028 is_raw: True - dataset_types: "calexp" collections: "LATISS/runs/AUXTEL_DRP_IMAGING_2022-11A/w_2022_46/PREOPS-1616/20221111T182132Z"