This commit is contained in:
电大老baby 2026-11-06 16:36:23 +09:00 • committed by GitHub
commit 3927694607
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 1 deletions

View file

@ -80,7 +80,7 @@ class BitBucketClient:
self.repository = config.get("repository")
self.access_token = config.get("access_token")
self.branch = config.get("branch", "main")
self.base_url = config.get("", "https://api.bitbucket.org/2.0")
self.base_url = config.get("base_url", "https://api.bitbucket.org/2.0")
self.auth_method = config.get("auth_method", "token")
self.username = config.get("username")

View file

@ -65,6 +65,28 @@ def test_bitbucket_client_initialization():
assert client_basic.username == "test-user"
def test_bitbucket_client_uses_configured_base_url():
config = {
"workspace": "test-workspace",
"repository": "test-repo",
"access_token": "test-token",
"base_url": "https://bitbucket.example.com/2.0",
}
with patch("litellm.integrations.bitbucket.bitbucket_client.HTTPHandler") as handler_cls:
client = BitBucketClient(config)
handler_cls.return_value.get.return_value = MagicMock(
headers={"content-type": "text/plain"}, text="prompt"
)
client.get_file_content("prompts/test.prompt")
assert (
handler_cls.return_value.get.call_args.args[0]
== "https://bitbucket.example.com/2.0/repositories/test-workspace/test-repo/src/main/prompts/test.prompt"
)
def test_bitbucket_client_missing_required_fields():
"""Test BitBucketClient initialization with missing required fields."""
with pytest.raises(