File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,7 @@ def parse_data_dict(
241
241
rpc : bool = False ,
242
242
rpcreply : bool = False ,
243
243
notification : bool = False ,
244
+ store_only : bool = False ,
244
245
) -> "libyang.data.DNode" :
245
246
"""
246
247
Convert a python dictionary to a DNode object following the schema of this
@@ -276,6 +277,7 @@ def parse_data_dict(
276
277
rpc = rpc ,
277
278
rpcreply = rpcreply ,
278
279
notification = notification ,
280
+ store_only = store_only ,
279
281
)
280
282
281
283
Original file line number Diff line number Diff line change @@ -1112,3 +1112,22 @@ def test_dnode_builtin_plugins_only(self):
1112
1112
self .assertIsInstance (dnode , DLeaf )
1113
1113
self .assertEqual (dnode .value (), "test" )
1114
1114
dnode .free ()
1115
+
1116
+ def test_merge_store_only (self ):
1117
+ MAIN = {"yolo-nodetypes:test1" : 50 }
1118
+ module = self .ctx .load_module ("yolo-nodetypes" )
1119
+ dnode = module .parse_data_dict (MAIN , validate = False , store_only = True )
1120
+ self .assertIsInstance (dnode , DLeaf )
1121
+ self .assertEqual (dnode .value (), 50 )
1122
+ dnode .free ()
1123
+
1124
+ def test_merge_builtin_plugins_only (self ):
1125
+ MAIN = {"yolo-nodetypes:ip-address" : "test" }
1126
+ self .tearDown ()
1127
+ gc .collect ()
1128
+ self .ctx = Context (YANG_DIR , builtin_plugins_only = True )
1129
+ module = self .ctx .load_module ("yolo-nodetypes" )
1130
+ dnode = module .parse_data_dict (MAIN , validate = False , store_only = True )
1131
+ self .assertIsInstance (dnode , DLeaf )
1132
+ self .assertEqual (dnode .value (), "test" )
1133
+ dnode .free ()
You can’t perform that action at this time.
0 commit comments