mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-12-19 03:42:22 -06:00
fix: fix a few unit tests
Copybara import of the project: -- 93cc9c0b71a92991a888c93675ddc8aee11f21dc by luaifei <lu.aifei@thoughtworks.com>: fix: Update skipped tests in test_auth_handlers -- 06ddf559c76c113231719bff549d41801a93daf4 by luaifei <lu.aifei@thoughtworks.com>: fix: Update skipped & failed tests in test_connections_client and test_streaming -- b8f2d357c1101c59ee9b65fa89a75f216e014a7c by luaifei <lu.aifei@thoughtworks.com>: fix: Remove ignored test file from Python unit tests workflow COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/553 from luaifei:fix-tests d51e42841e71d388c16cc719a4798b029182084f PiperOrigin-RevId: 755669644
This commit is contained in:
committed by
Copybara-Service
parent
e4317c9eb7
commit
d5b3a89fe7
@@ -15,12 +15,12 @@
|
||||
import copy
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from fastapi.openapi.models import APIKey
|
||||
from fastapi.openapi.models import APIKeyIn
|
||||
from fastapi.openapi.models import OAuth2
|
||||
from fastapi.openapi.models import OAuthFlowAuthorizationCode
|
||||
from fastapi.openapi.models import OAuthFlows
|
||||
import pytest
|
||||
|
||||
from google.adk.auth.auth_credential import AuthCredential
|
||||
from google.adk.auth.auth_credential import AuthCredentialTypes
|
||||
@@ -58,7 +58,7 @@ class MockOAuth2Session:
|
||||
self.redirect_uri = redirect_uri
|
||||
self.state = state
|
||||
|
||||
def create_authorization_url(self, url):
|
||||
def create_authorization_url(self, url, **kwargs):
|
||||
return f"{url}?client_id={self.client_id}&scope={self.scope}", "mock_state"
|
||||
|
||||
def fetch_token(
|
||||
@@ -238,7 +238,6 @@ class TestGetCredentialKey:
|
||||
class TestGenerateAuthUri:
|
||||
"""Tests for the generate_auth_uri method."""
|
||||
|
||||
@pytest.mark.skip(reason="broken tests")
|
||||
@patch("google.adk.auth.auth_handler.OAuth2Session", MockOAuth2Session)
|
||||
def test_generate_auth_uri_oauth2(self, auth_config):
|
||||
"""Test generating an auth URI for OAuth2."""
|
||||
@@ -251,7 +250,6 @@ class TestGenerateAuthUri:
|
||||
assert "client_id=mock_client_id" in result.oauth2.auth_uri
|
||||
assert result.oauth2.state == "mock_state"
|
||||
|
||||
@pytest.mark.skip(reason="broken tests")
|
||||
@patch("google.adk.auth.auth_handler.OAuth2Session", MockOAuth2Session)
|
||||
def test_generate_auth_uri_openid(
|
||||
self, openid_auth_scheme, oauth2_credentials
|
||||
|
||||
Reference in New Issue
Block a user