Skip to content

Commit

Permalink
Slightly larger token size for the test, because 100 isn't always big…
Browse files Browse the repository at this point in the history
… enough for a structured result
  • Loading branch information
TechNickAI committed Jul 14, 2023
1 parent 1127226 commit c2505d6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ def test_commit(cli_runner, temp_git_repo):
with cli_runner.isolated_filesystem():
os.chdir(temp_git_repo.working_dir) # change to the temporary repo directory

response_token_size = 200 # smaller than the default so tests go a little faster
# Scenario 1: Only unstaged changes
create_and_write_file("test1.txt", "This is a test file.")
repo = Repo(temp_git_repo.working_dir)
repo.git.add("test1.txt") # stage the new file
result = cli_runner.invoke(cli, ["commit", "-y"])
result = cli_runner.invoke(cli, ["commit", "-y", "-t", response_token_size])
assert result.exit_code == 0
assert "✅ 1 file(s) committed" in result.output

Expand All @@ -32,12 +33,12 @@ def test_commit(cli_runner, temp_git_repo):
repo = Repo(temp_git_repo.working_dir)
repo.git.add("test2.txt") # stage the new file
create_and_write_file("test3.txt", "This is yet another test file.") # unstaged file
result = cli_runner.invoke(cli, ["commit", "-y"])
result = cli_runner.invoke(cli, ["commit", "-y", "-t", response_token_size])
assert result.exit_code == 0
assert "✅ 1 file(s) committed" in result.output

# Scenario 3: No changes at all
result = cli_runner.invoke(cli, ["commit", "-y"])
result = cli_runner.invoke(cli, ["commit", "-y", "-t", response_token_size])
assert result.exit_code == 0
assert "No changes" in result.output

Expand Down

1 comment on commit c2505d6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖AICodeBot Review Comments:

The change in the git repository looks good overall. However, I have a few comments:

  1. In the test_commit function, the variable 'response_token_size' is assigned a value of 200. It would be helpful to add a comment explaining why this value was chosen and why it is smaller than the default.

  2. In the test_commit function, the cli_runner.invoke calls have been modified to include the '-t' option with the 'response_token_size' variable. It would be beneficial to add a comment explaining the purpose of this option and how it affects the behavior of the command.

Please address these comments before merging the code. Thank you.

AICodeBot

Please sign in to comment.