[rtems-central commit] items: Return empty type string by default

Sebastian Huber sebh at rtems.org
Mon Jun 26 19:05:41 UTC 2023


Module:    rtems-central
Branch:    master
Commit:    0985eaadc9401f7242029deb005089b1f827cfe3
Changeset: http://git.rtems.org/rtems-central/commit/?id=0985eaadc9401f7242029deb005089b1f827cfe3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue May 30 11:39:57 2023 +0200

items: Return empty type string by default

---

 rtemsspec/items.py                 | 1 +
 rtemsspec/tests/test_items_item.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/rtemsspec/items.py b/rtemsspec/items.py
index 4b57cee6..da68d4f3 100644
--- a/rtemsspec/items.py
+++ b/rtemsspec/items.py
@@ -207,6 +207,7 @@ class Item:
 
     # pylint: disable=too-many-public-methods
     def __init__(self, item_cache: "ItemCache", uid: str, data: Any):
+        data["_type"] = ""
         self._cache = item_cache
         self._ident = _UID_TO_UPPER.sub(_match_to_upper, uid)
         self._uid = uid
diff --git a/rtemsspec/tests/test_items_item.py b/rtemsspec/tests/test_items_item.py
index 1b4dd9f4..a834097b 100644
--- a/rtemsspec/tests/test_items_item.py
+++ b/rtemsspec/tests/test_items_item.py
@@ -84,7 +84,7 @@ def test_data():
     data = {}
     data["x"] = "y"
     item = Item(EmptyItemCache(), "z", data)
-    assert item.data == {"x": "y"}
+    assert item.data == {"_type": "", "x": "y"}
 
 
 def test_cache():



More information about the vc mailing list