Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test_material.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file test_material.py
1 import pytest
2 from pathlib import Path
3 
4 import acts
5 
6 from acts import MaterialMapJsonConverter, JsonMaterialDecorator
7 
8 
9 @pytest.mark.root
10 def test_material_root(conf_const):
11  with pytest.raises(TypeError):
12  acts.examples.RootMaterialDecorator()
13  fileName = "blubb.root"
14  try:
15  conf_const(
16  acts.examples.RootMaterialDecorator,
17  level=acts.logging.INFO,
18  fileName=fileName,
19  )
20  except RuntimeError as e:
21  assert fileName in str(e)
22 
23 
25  config = MaterialMapJsonConverter.Config()
26  deco = JsonMaterialDecorator(
27  rConfig=config,
28  jFileName=str(
29  Path(__file__).parent.parent.parent.parent
30  / "thirdparty/OpenDataDetector/config/odd-material-mapping-config.json"
31  ),
32  level=acts.logging.WARNING,
33  )