Skip to content

Commit 3907bc3

Browse files
committed
Update tests to pass ruff checks for falsey/strings
1 parent fb3c08a commit 3907bc3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_coder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ def test_git_diff_context(temp_git_repo):
5454

5555
# Test empty repo (no commits, no staged files, no unstaged changes)
5656
diff = Coder.git_diff_context()
57-
assert diff == ""
57+
assert not diff
5858

5959
# Add a new file but don't stage it
6060
create_and_write_file("newfile.txt", "This is a new file.")
6161
diff = Coder.git_diff_context()
62-
assert diff == "", "New file should not be included in diff until it is staged"
62+
assert not diff, "New file should not be included in diff until it is staged"
6363

6464
# Stage the new file
6565
temp_git_repo.git.add("newfile.txt")
@@ -70,7 +70,7 @@ def test_git_diff_context(temp_git_repo):
7070
# Commit the new file
7171
temp_git_repo.git.commit("-m", "Add newfile.txt")
7272
diff = Coder.git_diff_context()
73-
assert diff == ""
73+
assert not diff
7474

7575
# Test diff for a specific commit
7676
commit = temp_git_repo.head.commit.hexsha
@@ -92,7 +92,7 @@ def test_git_diff_context(temp_git_repo):
9292
# Commit the modified file
9393
temp_git_repo.git.commit("-m", "Modify newfile.txt")
9494
diff = Coder.git_diff_context()
95-
assert diff == ""
95+
assert not diff
9696

9797
# Rename the file but don't stage it
9898
temp_git_repo.git.mv("newfile.txt", "renamedfile.txt")
@@ -107,7 +107,7 @@ def test_git_diff_context(temp_git_repo):
107107
# Commit the renamed file
108108
temp_git_repo.git.commit("-m", "Rename newfile.txt to renamedfile.txt")
109109
diff = Coder.git_diff_context()
110-
assert diff == ""
110+
assert not diff
111111

112112
# Test diff for a specific commit
113113
commit = temp_git_repo.head.commit.hexsha

0 commit comments

Comments
 (0)