mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-23 22:35:21 +02:00
Merge pull request #2959 from UmakanthKaspa/add-git-status-test
Add test for git_status function
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import git
|
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
|
import shutil
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@@ -91,3 +91,9 @@ def test_git_add_specific_files(test_repository):
|
|||||||
assert "file1.txt" in staged_files
|
assert "file1.txt" in staged_files
|
||||||
assert "file2.txt" not in staged_files
|
assert "file2.txt" not in staged_files
|
||||||
assert result == "Files staged successfully"
|
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