File indexing completed on 2025-01-30 09:14:56
0001 import pytest
0002 from pathlib import Path
0003
0004 import acts
0005
0006 from acts import MaterialMapJsonConverter, JsonMaterialDecorator
0007
0008
0009 @pytest.mark.root
0010 def test_material_root(conf_const):
0011 with pytest.raises(TypeError):
0012 acts.examples.RootMaterialDecorator()
0013 fileName = "blubb.root"
0014 try:
0015 conf_const(
0016 acts.examples.RootMaterialDecorator,
0017 level=acts.logging.INFO,
0018 fileName=fileName,
0019 )
0020 except RuntimeError as e:
0021 assert fileName in str(e)
0022
0023
0024 def test_json_material_decorator():
0025 config = MaterialMapJsonConverter.Config()
0026 deco = JsonMaterialDecorator(
0027 rConfig=config,
0028 jFileName=str(
0029 Path(__file__).parent.parent.parent.parent
0030 / "thirdparty/OpenDataDetector/config/odd-material-mapping-config.json"
0031 ),
0032 level=acts.logging.WARNING,
0033 )