mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-23 02:45:37 -04:00
6d5d601804
* feat(oauth): implement OAuth authorization URL and credentials retrieval - Added OAuthGetAuthorizationUrlRequest and OAuthGetCredentialsRequest models for handling OAuth requests. - Introduced methods in PluginExecutor for generating OAuth authorization URLs and retrieving OAuth credentials. - Updated ToolProvider interface to include OAuth methods for authorization URL and credentials handling. - Refactored PluginInvokeType and related action enums to support OAuth actions.
21 lines
510 B
Python
21 lines
510 B
Python
import pytest
|
|
|
|
from dify_plugin.interfaces.tool import ToolProvider
|
|
|
|
|
|
def test_construct_tool_provider():
|
|
"""
|
|
Test that the ToolProvider can be constructed without implementing any methods
|
|
"""
|
|
provider = ToolProvider()
|
|
assert provider is not None
|
|
|
|
|
|
def test_oauth_get_authorization_url():
|
|
"""
|
|
Test that the ToolProvider can get the authorization url
|
|
"""
|
|
provider = ToolProvider()
|
|
with pytest.raises(NotImplementedError):
|
|
provider.oauth_get_authorization_url({})
|