Skip to content

Commit 177d37c

Browse files
authored
Enhance test for 'init' command to skip config creation when it exists (#24)
1 parent 17d1c97 commit 177d37c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ def mock_get_config_path():
117117
return config_path
118118
monkeypatch.setattr(utils, "get_config_path", mock_get_config_path)
119119

120-
# Mock Path.exists for the specific config_path instance
121-
config_path.exists = mock.Mock(return_value=True)
120+
# Mock Path.exists to return True
121+
def mock_exists(self):
122+
return True
123+
monkeypatch.setattr(Path, "exists", mock_exists)
122124

123125
# Execute init command
124126
args = mock.Mock()

0 commit comments

Comments
 (0)