Skip to content

Commit 416c29a

Browse files
committed
coverage for non exist golden path
1 parent 318fcc8 commit 416c29a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/config_test.py

+11
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,17 @@ def is_file_side_effect(filename):
430430
assert result.exit_code == 0
431431
assert expected_output in result.output
432432

433+
def test_load_minigraph_with_non_exist_golden_config_path(self, get_cmd_module):
434+
def is_file_side_effect(filename):
435+
return True if 'golden_config' in filename else False
436+
with mock.patch("utilities_common.cli.run_command", mock.MagicMock(side_effect=mock_run_command_side_effect)) as mock_run_command, \
437+
mock.patch('os.path.isfile', mock.MagicMock(side_effect=is_file_side_effect)):
438+
(config, show) = get_cmd_module
439+
runner = CliRunner()
440+
result = runner.invoke(config.config.commands["load_minigraph"], ["-p", "non_exist.json", "-y"])
441+
assert result.exit_code != 0
442+
assert "Cannot find 'non_exist.json'" in result.output
443+
433444
def test_load_minigraph_with_golden_config_path(self, get_cmd_module):
434445
def is_file_side_effect(filename):
435446
return True if 'golden_config' in filename else False

0 commit comments

Comments
 (0)