diff --git a/src/uwtools/drivers/chgres_cube.py b/src/uwtools/drivers/chgres_cube.py index ddf408963..41e4a202b 100644 --- a/src/uwtools/drivers/chgres_cube.py +++ b/src/uwtools/drivers/chgres_cube.py @@ -110,5 +110,14 @@ def driver_name(cls) -> str: """ return STR.chgrescube + @property + def output(self) -> dict[str, list[str]]: + """ + Returns a description of the file(s) created when this component runs. + """ + output_types = ["atm", "sfc"] + paths = [f"{self.rundir}/out.{t}.tile7.nc" for t in output_types] + return {"netcdffiles": paths} + set_driver_docstring(ChgresCube) diff --git a/src/uwtools/tests/drivers/test_chgres_cube.py b/src/uwtools/tests/drivers/test_chgres_cube.py index d8385c47f..5b8761058 100644 --- a/src/uwtools/tests/drivers/test_chgres_cube.py +++ b/src/uwtools/tests/drivers/test_chgres_cube.py @@ -10,11 +10,10 @@ import f90nml # type: ignore from iotaa import refs -from pytest import fixture, mark, raises +from pytest import fixture, mark from uwtools.drivers.chgres_cube import ChgresCube from uwtools.drivers.driver import Driver -from uwtools.exceptions import UWNotImplementedError from uwtools.logging import log from uwtools.scheduler import Slurm from uwtools.tests.support import logged, regex_logged @@ -107,7 +106,6 @@ def leadtime(): "_scheduler", "_validate", "_write_runscript", - "output", "run", ], ) @@ -150,9 +148,9 @@ def test_ChgresCube_namelist_file_missing_base_file(caplog, driverobj): def test_ChgresCube_output(driverobj): - with raises(UWNotImplementedError) as e: - assert driverobj.output - assert str(e.value) == "The output() method is not yet implemented for this driver" + files = ["out.atm.tile7.nc", "out.sfc.tile7.nc"] + expected = {"netcdffiles": [str(driverobj.rundir / file) for file in files]} + assert driverobj.output == expected def test_ChgresCube_provisioned_rundir(driverobj):