Skip to content

Commit

Permalink
iifix test
Browse files Browse the repository at this point in the history
  • Loading branch information
wen587 committed Dec 5, 2024
1 parent 415d24c commit 0932fe7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ def teardown_class(cls):

class TestReloadConfig(object):
dummy_cfg_file = os.path.join(os.sep, "tmp", "config.json")
dummy_golden_cfg_file = os.path.join(os.sep, "tmp", "golden_config.json")

@classmethod
def setup_class(cls):
Expand Down Expand Up @@ -1433,7 +1434,7 @@ def test_reload_yang_config(self, get_cmd_module,
== RELOAD_YANG_CFG_OUTPUT.format(config.SYSTEM_RELOAD_LOCK)

def test_reload_config_fails_yang_validation(self, get_cmd_module, setup_single_broadcom_asic):
with open(self.dummy_cfg_file, 'w') as f:
with open(self.dummy_golden_cfg_file, 'w') as f:
device_metadata = {
"DEVICE_METADATA": {
"localhost": {
Expand All @@ -1452,7 +1453,7 @@ def test_reload_config_fails_yang_validation(self, get_cmd_module, setup_single_

result = runner.invoke(
config.config.commands["reload"],
[self.dummy_cfg_file, '-y', '-f'])
[self.dummy_golden_cfg_file, '-y', '-f'])

print(result.exit_code)
print(result.output)
Expand All @@ -1464,6 +1465,7 @@ def test_reload_config_fails_yang_validation(self, get_cmd_module, setup_single_
def teardown_class(cls):
os.environ['UTILITIES_UNIT_TESTING'] = "0"
os.remove(cls.dummy_cfg_file)
os.remove(cls.dummy_golden_cfg_file)
print("TEARDOWN")


Expand Down

0 comments on commit 0932fe7

Please sign in to comment.