From 400d569b5aafa9abd859394a6cb1f075f080c429 Mon Sep 17 00:00:00 2001 From: Roy Stegeman Date: Mon, 25 Nov 2024 18:28:33 +0000 Subject: [PATCH] add test_unique_theoryid_variations --- .../tests/test_scalevariationtheoryids.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 validphys2/src/validphys/tests/test_scalevariationtheoryids.py diff --git a/validphys2/src/validphys/tests/test_scalevariationtheoryids.py b/validphys2/src/validphys/tests/test_scalevariationtheoryids.py new file mode 100644 index 0000000000..1d6f9a17ad --- /dev/null +++ b/validphys2/src/validphys/tests/test_scalevariationtheoryids.py @@ -0,0 +1,18 @@ +import importlib.resources as resources + +from ruamel.yaml import YAML + +import validphys.scalevariations + +yaml = YAML() + + +def test_unique_theoryid_variations(): + """Check that for each theoryid there is only one set of scale variations in + scalevariationtheoryids.yaml + """ + file_path = resources.files(validphys.scalevariations).joinpath("scalevariationtheoryids.yaml") + with file_path.open("r") as file: + data = yaml.load(file) + thids = [k["theoryid"] for k in data["scale_variations_for"]] + assert len(thids) == len(set(thids))