Skip to content

Commit

Permalink
Fix test for checking status globally 👷
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwant committed Feb 11, 2022
1 parent db6f98d commit 904d79f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion podmena/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def status():
active = False
git_root_dir = get_git_root_dir()
if git_root_dir is not None:

local_hooks_path = os.path.join(git_root_dir, ".git", "hooks")
database_path = os.path.join(local_hooks_path, config.DATABASE_FILE)
hook_path = os.path.join(local_hooks_path, config.HOOK_FILENAME)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def test_status_active_globally(
):
confirm_mock.return_value = False # skip actual installation here
check_exists_mock.return_value = True
get_git_root_dir_mock.return_value = None
get_git_config_hooks_value_mock.return_value = config.GLOBAL_HOOKS_DIR

runner.invoke(cli.cli, ["install", "global"])
Expand All @@ -146,8 +147,9 @@ def test_status_inactive(
get_git_root_dir_mock,
runner,
):
result = runner.invoke(cli.cli, ["status"])
get_git_root_dir_mock.return_value = None

result = runner.invoke(cli.cli, ["status"])
get_git_root_dir_mock.assert_called_once_with()
get_git_config_hooks_value_mock.assert_called_once_with()

Expand Down

0 comments on commit 904d79f

Please sign in to comment.