sysrepo: reading and writing unions
Change-Id: I2001d8c751fed278af51c4d2e7256904b1be7c01
diff --git a/tests/datastore_access.cpp b/tests/datastore_access.cpp
index d5f3e12..6979dba 100644
--- a/tests/datastore_access.cpp
+++ b/tests/datastore_access.cpp
@@ -319,6 +319,17 @@
REQUIRE(datastore.getItems("/example-schema:leafDecimal") == expected);
}
+ SECTION("unions")
+ {
+ datastore.setLeaf("/example-schema:unionIntString", int32_t{10});
+ REQUIRE_CALL(mock, write("/example-schema:unionIntString", std::nullopt, "10"s));
+ datastore.commitChanges();
+ DatastoreAccess::Tree expected {
+ {"/example-schema:unionIntString", int32_t{10}},
+ };
+ REQUIRE(datastore.getItems("/example-schema:unionIntString") == expected);
+ }
+
SECTION("operational data")
{
MockDataSupplier mockOpsData;