From 477381f167a355b54205b0e329162783ec255a5f Mon Sep 17 00:00:00 2001
From: chausman <chausman@nrao.edu>
Date: Thu, 26 Oct 2023 11:51:42 -0600
Subject: [PATCH] fix tests

---
 .../test/examples/evla_cal_final_manifest.json       |  1 -
 .../test/examples/evla_cal_manifest_2021-08-02.json  |  1 -
 .../ingest_envoy/test/test_evla_cal_manifest.py      | 10 +++-------
 .../pexable/ingest_envoy/test/test_launchers.py      | 12 ++++++------
 4 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/apps/cli/executables/pexable/ingest_envoy/test/examples/evla_cal_final_manifest.json b/apps/cli/executables/pexable/ingest_envoy/test/examples/evla_cal_final_manifest.json
index c4ae82b2e..1a47f80ac 100644
--- a/apps/cli/executables/pexable/ingest_envoy/test/examples/evla_cal_final_manifest.json
+++ b/apps/cli/executables/pexable/ingest_envoy/test/examples/evla_cal_final_manifest.json
@@ -1,6 +1,5 @@
 {
   "parameters": {
-    "reingest": false,
     "ngas_ingest": true,
     "telescope": "EVLA",
     "ingestion_path": "/lustre/aoc/cluster/pipeline/dsoc-prod/stage_products/20A-346_2021_07_23_T13_37_08.376"
diff --git a/apps/cli/executables/pexable/ingest_envoy/test/examples/evla_cal_manifest_2021-08-02.json b/apps/cli/executables/pexable/ingest_envoy/test/examples/evla_cal_manifest_2021-08-02.json
index e4dc509bb..026337514 100644
--- a/apps/cli/executables/pexable/ingest_envoy/test/examples/evla_cal_manifest_2021-08-02.json
+++ b/apps/cli/executables/pexable/ingest_envoy/test/examples/evla_cal_manifest_2021-08-02.json
@@ -1,6 +1,5 @@
 {
   "parameters": {
-    "reingest": false,
     "ngas_ingest": true,
     "telescope": "EVLA",
     "ingestion_path": "/lustre/aoc/cluster/pipeline/dsoc-prod/stage_products/20A-346_2021_07_23_T13_37_08.376"
diff --git a/apps/cli/executables/pexable/ingest_envoy/test/test_evla_cal_manifest.py b/apps/cli/executables/pexable/ingest_envoy/test/test_evla_cal_manifest.py
index 3eb8025d5..cc7c3136f 100644
--- a/apps/cli/executables/pexable/ingest_envoy/test/test_evla_cal_manifest.py
+++ b/apps/cli/executables/pexable/ingest_envoy/test/test_evla_cal_manifest.py
@@ -43,6 +43,7 @@ from ingest_envoy.manifest_components import (
     ManifestParameters,
     OutputGroup,
     OutputScienceProduct,
+    ParamsKey,
 )
 from ingest_envoy.utilities import AncillaryProductType, ScienceProductType, Telescope
 
@@ -88,7 +89,7 @@ def test_filters_cal_input_files(ingest_path: Path):
 
     assert manifest.locator == locator
     params = manifest.parameters
-    assert params.reingest is False and params.ngas_ingest is True
+    assert params.ngas_ingest is True
     assert not hasattr(params, "calibrate")
 
     input_group = manifest.input_group
@@ -162,7 +163,6 @@ def test_params_json_well_formed():
     """
     params = ManifestParameters(
         telescope=Telescope.EVLA,
-        reingest=False,
         ngas_ingest=False,
         calibrate=False,
         staging_source_dir=Path("/home/mchammer/evla/parallel-prod"),
@@ -331,13 +331,11 @@ def test_evla_cal_manifest_matches_example(ingest_path: Path):
     with open(manifest_file, "r") as infile:
         actual_json = dict(json.load(infile).items())
 
-    actual_json[IngestionManifestKey.PARAMETERS.value][IngestionManifestKey.INGESTION_PATH.value] = expected_dir_name
+    actual_json[IngestionManifestKey.PARAMETERS.value][ParamsKey.INGESTION_PATH.value] = expected_dir_name
 
     expected_params = expected_json["parameters"]
     actual_params = manifest.parameters.to_dict()
 
-    expected_reingest = expected_params["reingest"]
-    assert actual_params["reingest"] == expected_reingest
     expected_ngas_ingest = expected_params["ngas_ingest"]
     assert actual_params["ngas_ingest"] == expected_ngas_ingest
 
@@ -440,8 +438,6 @@ def test_evla_cal_final_manifest_matches_example(ingest_path: Path):
     expected_params = expected_json["parameters"]
     actual_params = manifest.parameters.to_dict()
 
-    expected_reingest = expected_params["reingest"]
-    assert actual_params["reingest"] == expected_reingest
     expected_ngas_ingest = expected_params["ngas_ingest"]
     assert actual_params["ngas_ingest"] == expected_ngas_ingest
 
diff --git a/apps/cli/executables/pexable/ingest_envoy/test/test_launchers.py b/apps/cli/executables/pexable/ingest_envoy/test/test_launchers.py
index c99bc10e3..b16c0d220 100644
--- a/apps/cli/executables/pexable/ingest_envoy/test/test_launchers.py
+++ b/apps/cli/executables/pexable/ingest_envoy/test/test_launchers.py
@@ -67,7 +67,7 @@ class TestIngestCalibrationLauncher:
     def test_launch_ingestion(self):
         with patch("ingest_envoy.launchers.IngestCalibrationLauncher.prepare_for_ingest") as prepare:
             with patch("ingest_envoy.launchers.trigger_ingest") as ingest:
-                IngestCalibrationLauncher(parameters).launch_ingestion()
+                IngestCalibrationLauncher(IngestType.CAL, parameters).launch()
                 assert prepare.call_count == 1
                 assert ingest.call_count == 1
 
@@ -75,20 +75,20 @@ class TestIngestCalibrationLauncher:
     def test_prepare_for_ingest(self, mock_run):
         with patch("ingest_envoy.launchers.IngestCalibrationLauncher.run_collection_script") as collector:
             with patch("ingest_envoy.launchers.IngestCalibrationLauncher.create_manifest") as manifest:
-                IngestCalibrationLauncher(parameters).prepare_for_ingest()
+                IngestCalibrationLauncher(IngestType.CAL, parameters).prepare_for_launch()
                 assert collector.call_count == 1
                 assert manifest.call_count == 1
 
     @patch("subprocess.run")
     def test_run_collection_script(self, mock_run):
         mock_run.return_value.returncode = 0
-        IngestCalibrationLauncher(parameters).run_collection_script()
+        IngestCalibrationLauncher(IngestType.CAL, parameters).run_collection_script()
         assert mock_run.call_count == 1
 
     @pytest.mark.skip("Skip. Ignores manifest builder mock")
     def test_create_manifest(self):
         with patch("ingest_envoy.ingestion_manifest.IngestionManifestBuilder.build") as manifest:
-            IngestCalibrationLauncher(parameters).create_manifest()
+            IngestCalibrationLauncher(IngestType.CAL, parameters).create_manifest()
             assert manifest.call_count == 1
 
 
@@ -96,14 +96,14 @@ class TestIngestImageLauncher:
     def test_launch_ingestion(self):
         with patch("ingest_envoy.launchers.IngestImageLauncher.prepare_for_ingest") as prepare:
             with patch("ingest_envoy.launchers.trigger_ingest") as ingest:
-                IngestImageLauncher(IngestType.IMG, image_parameters).launch_ingestion()
+                IngestImageLauncher(IngestType.IMG, image_parameters).launch()
                 assert prepare.call_count == 1
                 assert ingest.call_count == 1
 
     def test_prepare_for_ingest(self):
         with patch("ingest_envoy.launchers.IngestImageLauncher.run_collector") as collector:
             with patch("ingest_envoy.launchers.IngestImageLauncher.create_manifest") as manifest:
-                IngestImageLauncher(IngestType.IMG, image_parameters).prepare_for_ingest()
+                IngestImageLauncher(IngestType.IMG, image_parameters).prepare_for_launch()
                 assert collector.call_count == 1
                 assert manifest.call_count == 1
 
-- 
GitLab