Skip to content

Commit 16698b8

Browse files
committed
tests: add update parameter to subscription
Modify 2 subscriptions to test the update parameter. The module_change_cb is called on sysrepo update events. Signed-off-by: Jeremie Leska <[email protected]>
1 parent 28ee073 commit 16698b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: tests/test_subs_module_change.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_module_change_sub(self):
4545
expected_changes = []
4646

4747
def module_change_cb(event, req_id, changes, private_data):
48-
self.assertIn(event, ("change", "done", "abort"))
48+
self.assertIn(event, ("change", "done", "abort", "update"))
4949
self.assertIs(private_data, priv)
5050
for c in changes:
5151
if c.xpath == "/sysrepo-example:conf/system/hostname":
@@ -61,6 +61,7 @@ def module_change_cb(event, req_id, changes, private_data):
6161
"/sysrepo-example:conf",
6262
module_change_cb,
6363
private_data=priv,
64+
update=True,
6465
)
6566

6667
with self.conn.start_session("running") as ch_sess:
@@ -316,7 +317,7 @@ def test_module_change_sub_unsafe(self):
316317

317318
def module_change_cb(session, event, req_id, private_data):
318319
self.assertIsInstance(session, SysrepoSession)
319-
self.assertIn(event, ("change", "done", "abort"))
320+
self.assertIn(event, ("change", "done", "abort", "update"))
320321
self.assertIsInstance(req_id, int)
321322
self.assertIs(private_data, priv)
322323
changes = list(session.get_changes("/sysrepo-example:conf//."))
@@ -334,6 +335,7 @@ def module_change_cb(session, event, req_id, private_data):
334335
"/sysrepo-example:conf",
335336
module_change_cb,
336337
private_data=priv,
338+
update=True,
337339
)
338340

339341
with self.conn.start_session("running") as ch_sess:

0 commit comments

Comments
 (0)