Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
edit test
  • Loading branch information
SandrineP committed Jun 24, 2025
commit b0e8296415dc383d871a09a31c252b824e3d7441
19 changes: 15 additions & 4 deletions test/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,23 @@ def rename_git():
@pytest.mark.parametrize("short_flag", ["", "-s", "--short"])
@pytest.mark.parametrize("long_flag", ["", "--long"])
def test_status_format(rename_git, git2cpp_path, short_flag, long_flag):
cmd = [git2cpp_path, 'status', short_flag, long_flag]
cmd = [git2cpp_path, 'status']
if short_flag != "":
cmd.append(short_flag)
if long_flag != "":
cmd.append(long_flag)
p = subprocess.run(cmd, capture_output=True, cwd="test/data/status_data", text=True)

if (long_flag == "--long") or ((long_flag == "") & (short_flag == "")):
assert "Changes to be committed" in p.stdout
elif short_flag in ["-s", "--short"]:
pass
assert "Changes not staged for commit" in p.stdout
assert "Untracked files" in p.stdout
assert "new file" in p.stdout
assert "deleted" in p.stdout
assert "modified" in p.stdout

print(p.stdout)
elif short_flag in ["-s", "--short"]:
assert "D " in p.stdout
assert " M " in p.stdout
assert " D " in p.stdout
assert "?? " in p.stdout