CLI: Allow deleting leaf nodes
This is allowed for YANG datastores; the semantics is that a default
value appears there if defined, otherwise the node just doesn't return
any data when requested.
Change-Id: I9e39ade3e08720b116a674650a02399cbffd854e
diff --git a/tests/leaf_editing.cpp b/tests/leaf_editing.cpp
index 1a55fa1..35e2ddc 100644
--- a/tests/leaf_editing.cpp
+++ b/tests/leaf_editing.cpp
@@ -617,4 +617,15 @@
REQUIRE_THROWS_AS(parser.parseCommand(input, errorStream), InvalidCommandException);
REQUIRE(errorStream.str().find(expectedError) != std::string::npos);
}
+
+ SECTION("deleting a leaf")
+ {
+ delete_ expected;
+ input = "delete mod:leafString";
+ expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafString")});
+
+ command_ command = parser.parseCommand(input, errorStream);
+ REQUIRE(command.type() == typeid(delete_));
+ REQUIRE(boost::get<delete_>(command) == expected);
+ }
}