From 3d9779247db34ce6b0d4cdb88569fc2cb47cf3f1 Mon Sep 17 00:00:00 2001 From: ganglyu Date: Fri, 28 Jul 2023 11:24:34 +0800 Subject: [PATCH] Add ut to improve coverage --- test/test_gnmi_appldb.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_gnmi_appldb.py b/test/test_gnmi_appldb.py index c3f1b037..7d5d9515 100644 --- a/test/test_gnmi_appldb.py +++ b/test/test_gnmi_appldb.py @@ -113,6 +113,24 @@ def test_gnmi_update_normal_02(self, test_data): ret, msg = gnmi_set([], update_list, []) assert ret != 0, "Invalid json ietf value" + @pytest.mark.parametrize('test_data', test_data_update_normal) + def test_gnmi_update_normal_03(self, test_data): + clear_appl_db('DASH_QOS') + clear_appl_db('DASH_VNET') + update_list = [] + get_list = [] + for i, data in enumerate(test_data): + path = data['update_path'] + value = "x" + file_name = 'update' + str(i) + file_object = open(file_name, 'w') + file_object.write(value) + file_object.close() + update_list.append(path + ':@./' + file_name) + + ret, msg = gnmi_set([], update_list, []) + assert ret != 0, "Invalid json ietf value" + @pytest.mark.parametrize('test_data', test_data_update_normal) def test_gnmi_delete_normal_01(self, test_data): delete_list = []