Skip to content
Snippets Groups Projects
Commit 92a5a311 authored by Janet Goldstein's avatar Janet Goldstein
Browse files

WS-543: removed cruft, fixed issues found by IJ code analysis, SonarLint, and pylint

TODO: fix or remove each of the disabled tests
parent 8be6d8e0
No related branches found
No related tags found
1 merge request!369WS-543: removed cruft; fixed issues found by IJ code analysis, SonarLint, and pylint
Pipeline #2292 passed
...@@ -7,7 +7,7 @@ import json ...@@ -7,7 +7,7 @@ import json
import logging import logging
import shutil import shutil
import sys import sys
from pathlib import Path, PurePath from pathlib import Path
# pylint: disable=E0401, E0402, R1721, W0621 # pylint: disable=E0401, E0402, R1721, W0621
...@@ -19,7 +19,6 @@ from ingest_envoy.ingestion_manifest import ( ...@@ -19,7 +19,6 @@ from ingest_envoy.ingestion_manifest import (
) )
from ingest_envoy.manifest_components import ( from ingest_envoy.manifest_components import (
IngestionManifestKey, IngestionManifestKey,
ParamsKey,
InputScienceProduct, InputScienceProduct,
InputGroup, InputGroup,
ManifestParameters, ManifestParameters,
...@@ -29,7 +28,6 @@ from ingest_envoy.manifest_components import ( ...@@ -29,7 +28,6 @@ from ingest_envoy.manifest_components import (
TARFILE_EXT, TARFILE_EXT,
ARTIFACT_NAME, ARTIFACT_NAME,
WEBLOG_FILENAME, WEBLOG_FILENAME,
MANIFEST_FILENAME,
) )
from ingest_envoy.utilities import ( from ingest_envoy.utilities import (
ScienceProductType, ScienceProductType,
...@@ -69,9 +67,9 @@ def test_filters_cal_input_files(ingest_path: Path): ...@@ -69,9 +67,9 @@ def test_filters_cal_input_files(ingest_path: Path):
populate_fake_evla_cal_ingest_path(ingest_path) populate_fake_evla_cal_ingest_path(ingest_path)
locator = "uid://evla/calibration/twinkle-twinkle-little-quasar" locator = "uid://evla/calibration/twinkle-twinkle-little-quasar"
manifest, _ = IngestionManifestBuilder( manifest, _ = IngestionManifestBuilder(
telescope=Telescope.EVLA, telescope=Telescope.EVLA.value,
staging_source_dir=ingest_path, staging_source_dir=ingest_path,
sp_type=ScienceProductType.EVLA_CAL, sp_type=ScienceProductType.EVLA_CAL.value,
locator=locator, locator=locator,
).build() ).build()
...@@ -117,7 +115,7 @@ def test_writes_expected_output_files(ingest_path: Path): ...@@ -117,7 +115,7 @@ def test_writes_expected_output_files(ingest_path: Path):
telescope=Telescope.EVLA.value, telescope=Telescope.EVLA.value,
staging_source_dir=ingest_path, staging_source_dir=ingest_path,
locator="uid://evla/calibration/fee-fi-fo-fum-acdf23", locator="uid://evla/calibration/fee-fi-fo-fum-acdf23",
sp_type=ScienceProductType.EVLA_CAL, sp_type=ScienceProductType.EVLA_CAL.value,
).build() ).build()
assert manifest_file assert manifest_file
assert manifest assert manifest
...@@ -327,52 +325,18 @@ def test_evla_cal_manifest_matches_example(ingest_path: Path): ...@@ -327,52 +325,18 @@ def test_evla_cal_manifest_matches_example(ingest_path: Path):
builder = IngestionManifestBuilder( builder = IngestionManifestBuilder(
staging_source_dir=ingest_path, staging_source_dir=ingest_path,
telescope=Telescope.EVLA.value, telescope=Telescope.EVLA.value,
sp_type=ScienceProductType.EVLA_CAL, sp_type=ScienceProductType.EVLA_CAL.value,
locator="uid://evla/execblock/48ba4c9d-d7c7-4a8f-9803-1115cd52459b", locator="uid://evla/execblock/48ba4c9d-d7c7-4a8f-9803-1115cd52459b",
) )
manifest, manifest_file = builder.build() _, manifest_file = builder.build()
with open(manifest_file, "r") as infile: with open(manifest_file, "r") as infile:
actual_json = dict(json.load(infile).items()) actual_json = dict(json.load(infile).items())
print(actual_json)
actual_json[IngestionManifestKey.PARAMETERS.value][ actual_json[IngestionManifestKey.PARAMETERS.value][
IngestionManifestKey.INGESTION_PATH.value IngestionManifestKey.INGESTION_PATH.value
] = expected_dir_name ] = expected_dir_name
assert (
actual_json[IngestionManifestKey.PARAMETERS.value]
== expected_json[IngestionManifestKey.PARAMETERS.value]
)
# actual_sps = actual_json[IngestionManifestKey.INPUT_GROUP.value]
actual_ig = actual_json[IngestionManifestKey.INPUT_GROUP.value]
expected_ig = expected_json[IngestionManifestKey.INPUT_GROUP.value]
assert actual_ig == expected_ig
# expected_sps = expected_json[IngestionManifestKey.INPUT_GROUP.value]
# assert actual_sps == expected_sps
# assert (
# actual_json[IngestionManifestKey.INPUT_GROUP.value][IngestionManifestKey.INPUT_GROUP.value]
# == expected_json[IngestionManifestKey.INPUT_GROUP.value]
# )
actual_og = actual_json[IngestionManifestKey.OUTPUT_GROUP.value]
expected_og = expected_json[IngestionManifestKey.OUTPUT_GROUP.value]
assert actual_og == expected_og
# assert (
# actual_og[IngestionManifestKey.SCIENCE_PRODUCTS.value]
# == expected_og[IngestionManifestKey.SCIENCE_PRODUCTS.value]
# )
#
# assert (
# actual_og[IngestionManifestKey.ANCILLARY_PRODUCTS.value]
# == expected_og[IngestionManifestKey.ANCILLARY_PRODUCTS.value]
# )
# TODO:
assert actual_json == expected_json assert actual_json == expected_json
shutil.rmtree(ingest_path) shutil.rmtree(ingest_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment