Commit afbb14ef authored by Matias Guijarro's avatar Matias Guijarro
Browse files

tests: add test for config user_tag

parent ffbb1bcf
......@@ -410,7 +410,7 @@ class ConfigNode(MutableMapping):
else:
ConfigNode.indexed_nodes[name] = node
elif key == ConfigNode.USER_TAG_KEY:
node = obj
node = self
user_tags = value if isinstance(value, MutableSequence) else [value]
for tag in user_tags:
ConfigNode.tagged_nodes[tag].add(node)
......
......@@ -281,3 +281,12 @@ def test_issue_1619(beacon):
# return the same thing
assert obj_cfg is obj
assert obj["test"] == x == obj_cfg["test"]
def test_user_tags(beacon):
objs = [("diode", "diode2", "diode3"), ("robz",)]
assert beacon.user_tags_list == ["TEST.DIODE", "TEST.ROBZ"]
for obj_list, tag in zip(objs, beacon.user_tags_list):
assert set(
[beacon.get_config(obj) for obj in obj_list]
) == beacon.get_user_tag_configs(tag)
......@@ -3,14 +3,17 @@
plugin: bliss
class: simulation_diode
independent: True
user_tag: TEST.DIODE
-
name: diode2
plugin: bliss
class: simulation_diode
user_tag: TEST.DIODE
-
name: diode3
plugin: bliss
class: simulation_diode
user_tag: TEST.DIODE
-
name: integ_diode
......
......@@ -19,6 +19,7 @@ controller:
low_limit: -1000
high_limit: 1000000000.0
unit: mm
user_tag: TEST.ROBZ
- name: robz2
steps_per_unit: 10000
velocity: 1000
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment