Skip to content

Commit 2e026a5

Browse files
samuel-gauthierrjarry
authored andcommitted
tests: fix oper_sub_with_extra_info
The oper_sub_with_extra_info currently fails with this error: > ====================================================================== > FAIL: test_oper_sub_with_extra_info (test_subs_oper.OperSubscriptionTest) > ---------------------------------------------------------------------- >Traceback (most recent call last): > File "/root/tmp/sysrepo-python/tests/test_subs_oper.py", line 105, in test_oper_sub_with_extra_info > self.assertEqual(oper_data, {"state": {}}) > AssertionError: {'state': {'system': {}, 'network': {}}} != {'state': {}} > - {'state': {'network': {}, 'system': {}}} > + {'state': {}} It is safe to assume that sysrepo changed its behavior in current branch, in a commit that I did not try to identify. There are several ways to fix this, the simplest being to set keep_empty_containers to False, and expect empty datas. Indeed, what really matters in this test is checking the extra infos (which is done in the callback). Signed-off-by: Samuel Gauthier <[email protected]>
1 parent a7b6d15 commit 2e026a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_subs_oper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def oper_data_cb(xpath, private_data, **kwargs):
9999
with self.conn.start_session("operational") as op_sess:
100100
op_sess.set_extra_info("netopeer2", 12, getpass.getuser())
101101
oper_data = op_sess.get_data(
102-
"/sysrepo-example:state", keep_empty_containers=True
102+
"/sysrepo-example:state", keep_empty_containers=False
103103
)
104104
self.assertEqual(len(calls), 1)
105-
self.assertEqual(oper_data, {"state": {}})
105+
self.assertEqual(oper_data, {})

0 commit comments

Comments
 (0)