summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rtemsspec/items.py3
-rw-r--r--rtemsspec/tests/test_items_item.py2
2 files changed, 5 insertions, 0 deletions
diff --git a/rtemsspec/items.py b/rtemsspec/items.py
index 84fca2a2..6e87245a 100644
--- a/rtemsspec/items.py
+++ b/rtemsspec/items.py
@@ -112,6 +112,9 @@ class Link:
def __getitem__(self, name: str) -> Any:
return self._data[name]
+ def __setitem__(self, key: str, value: Any) -> None:
+ self._data[key] = value
+
@property
def item(self) -> "Item":
""" The item referenced by this link. """
diff --git a/rtemsspec/tests/test_items_item.py b/rtemsspec/tests/test_items_item.py
index e84ce276..f2a137d5 100644
--- a/rtemsspec/tests/test_items_item.py
+++ b/rtemsspec/tests/test_items_item.py
@@ -173,6 +173,8 @@ def test_parents():
child.init_parents(item_cache)
for link in child.links_to_parents():
link.item.add_link_to_child(Link.create(link, child))
+ link["foo"] = "bar"
+ assert child["links"][0]["foo"] == "bar"
parents = [item for item in child.parents()]
assert len(parents) == 1
assert parents[0] == parent