Skip to content

Commit

Permalink
Update tests to pass ruff checks for falsey/strings
Browse files Browse the repository at this point in the history
  • Loading branch information
TechNickAI committed Jul 11, 2023
1 parent fb3c08a commit 3907bc3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def test_git_diff_context(temp_git_repo):

# Test empty repo (no commits, no staged files, no unstaged changes)
diff = Coder.git_diff_context()
assert diff == ""
assert not diff

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

# Stage the new file
temp_git_repo.git.add("newfile.txt")
Expand All @@ -70,7 +70,7 @@ def test_git_diff_context(temp_git_repo):
# Commit the new file
temp_git_repo.git.commit("-m", "Add newfile.txt")
diff = Coder.git_diff_context()
assert diff == ""
assert not diff

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

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

# Test diff for a specific commit
commit = temp_git_repo.head.commit.hexsha
Expand Down

0 comments on commit 3907bc3

Please sign in to comment.