Skip to content

Commit 3183e88

Browse files
authored
Remove event yang models from test count (#36)
1 parent d389d89 commit 3183e88

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,13 @@ def test_validate_yang_models(self, sonic_yang_data):
292292
'''
293293
test_file = sonic_yang_data['test_file']
294294
syc = sonic_yang_data['syc']
295-
# Currently only 3 YANG files are not directly related to config
295+
# Currently only 3 YANG files are not directly related to config, along with event YANG models
296296
# which are: sonic-extension.yang, sonic-types.yang and sonic-bgp-common.yang. Hard coding
297297
# it right now.
298+
# event YANG models do not map directly to config_db and are included to NON_CONFIG_YANG_FILES at run time
298299
# If any more such helper yang files are added, we need to update here.
299-
NON_CONFIG_YANG_FILES = 3
300+
EVENT_YANG_FILES = sum(1 for yang_model in syc.yangFiles if 'sonic-events' in yang_model)
301+
NON_CONFIG_YANG_FILES = 3 + EVENT_YANG_FILES
300302
# read config
301303
jIn = self.readIjsonInput(test_file, 'SAMPLE_CONFIG_DB_JSON')
302304
jIn = json.loads(jIn)

0 commit comments

Comments
 (0)