From c2505d6e80756b2e581f1aebdd4e3734b59bc0b4 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Fri, 14 Jul 2023 14:28:03 -0700 Subject: [PATCH] Slightly larger token size for the test, because 100 isn't always big enough for a structured result --- tests/test_cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 9b8c4a0..fed2bc9 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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 @@ -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