forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_material.py
More file actions
32 lines (26 loc) · 840 Bytes
/
test_material.py
File metadata and controls
32 lines (26 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import pytest
import acts
from acts.json import MaterialMapJsonConverter, JsonMaterialDecorator
from acts.examples.odd import getOpenDataDetectorDirectory
@pytest.mark.root
def test_material_root(conf_const):
with pytest.raises(TypeError):
acts.root.RootMaterialDecorator()
fileName = "blubb.root"
try:
conf_const(
acts.root.RootMaterialDecorator,
level=acts.logging.INFO,
fileName=fileName,
)
except RuntimeError as e:
assert fileName in str(e)
def test_json_material_decorator():
config = MaterialMapJsonConverter.Config()
deco = JsonMaterialDecorator(
rConfig=config,
jFileName=str(
getOpenDataDetectorDirectory() / "config/odd-material-mapping-config.json"
),
level=acts.logging.WARNING,
)