Fix NetconfAccess::deleteListInstance
Yet another problem Data_Node problem - you get the whole tree from
dataNodeFromPath, not the actual node you wanted. It seems I fixed it
previously with a child() call, which is wrong and won't work with a lot
of stuff.
Change-Id: I074f24e628b907edeadbd822803a99be639fb0b1
diff --git a/tests/datastore_access.cpp b/tests/datastore_access.cpp
index 4a25803..fe7df81 100644
--- a/tests/datastore_access.cpp
+++ b/tests/datastore_access.cpp
@@ -138,12 +138,20 @@
datastore.commitChanges();
}
- SECTION("create a list instance")
+ SECTION("create/delete a list instance")
{
- REQUIRE_CALL(mock, write("/example-schema:person[name='Nguyen']", std::nullopt, ""s));
- REQUIRE_CALL(mock, write("/example-schema:person[name='Nguyen']/name", std::nullopt, "Nguyen"s));
- datastore.createListInstance("/example-schema:person[name='Nguyen']");
- datastore.commitChanges();
+ {
+ REQUIRE_CALL(mock, write("/example-schema:person[name='Nguyen']", std::nullopt, ""s));
+ REQUIRE_CALL(mock, write("/example-schema:person[name='Nguyen']/name", std::nullopt, "Nguyen"s));
+ datastore.createListInstance("/example-schema:person[name='Nguyen']");
+ datastore.commitChanges();
+ }
+ {
+ REQUIRE_CALL(mock, write("/example-schema:person[name='Nguyen']", ""s, std::nullopt));
+ REQUIRE_CALL(mock, write("/example-schema:person[name='Nguyen']/name", "Nguyen"s, std::nullopt));
+ datastore.deleteListInstance("/example-schema:person[name='Nguyen']");
+ datastore.commitChanges();
+ }
}
SECTION("leafref pointing to a key of a list")