diff --git a/commands/cmd_test_end_to_end.py b/commands/cmd_test_end_to_end.py index 0197ce85..05ae0853 100644 --- a/commands/cmd_test_end_to_end.py +++ b/commands/cmd_test_end_to_end.py @@ -87,7 +87,15 @@ def cmd_test_end_to_end_update_expectations(args: Any): def cmd_test_end_to_end_create_expectation(args: Any): - filename = "production_" + args.ags + "_" + str(args.year_target) + ".json" + filename = ( + "production_" + + args.ags + + "_" + + str(args.year_baseline) + + "_" + + str(args.year_target) + + ".json" + ) for year_ref in [2018, 2021]: filepath = os.path.join(test_dir, f"{year_ref}", filename) update_expectation( diff --git a/tests/end_to_end_expected/README.rst b/tests/end_to_end_expected/README.rst index 50420fae..fd58dc9f 100644 --- a/tests/end_to_end_expected/README.rst +++ b/tests/end_to_end_expected/README.rst @@ -1,11 +1,8 @@ End to end test expected results ================================ -This directory contains one file per ags it ran for. Those are encoded in the filename: `production_.json` +This directory contains one file per ags and year combination it ran for. Those are encoded in the filename: `production___.json` +The year of the reference data is encoded in the foldername. If you want to generate a fresh version of all expected results call 'python devtool.py test_end_to_end update_expectations'. -If you want to create a new expectation file for a new ags call 'python devtool.py test_end_to_end create_expectation -ags '. - - TODO: This currently doesn't handle any other inputs (e.g. year=...) or any of the others - and indeed just adding those to the filename will eventually not scale anymore ;-) But - again a problem for another day. +If you want to create a new expectation file for a new ags call 'python devtool.py test_end_to_end create_expectation -ags -year_baseline -year_target '.