mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-17 15:43:24 +02:00
Add test for git_status function
Adds test coverage for the previously untested git_status function. The test verifies that the function returns valid git status output containing branch information.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
import git
|
||||
from mcp_server_git.server import git_checkout, git_branch, git_add
|
||||
from mcp_server_git.server import git_checkout, git_branch, git_add, git_status
|
||||
import shutil
|
||||
|
||||
@pytest.fixture
|
||||
@@ -91,3 +91,9 @@ def test_git_add_specific_files(test_repository):
|
||||
assert "file1.txt" in staged_files
|
||||
assert "file2.txt" not in staged_files
|
||||
assert result == "Files staged successfully"
|
||||
|
||||
def test_git_status(test_repository):
|
||||
result = git_status(test_repository)
|
||||
|
||||
assert result is not None
|
||||
assert "On branch" in result or "branch" in result.lower()
|
||||
|
||||
Reference in New Issue
Block a user