-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed oauth_authorization_uri creation and added a test.
- Loading branch information
1 parent
512e57e
commit 0efd0f9
Showing
3 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from bunq.sdk.context.bunq_context import BunqContext | ||
from bunq.sdk.model.core.oauth_authorization_uri import OauthAuthorizationUri | ||
from bunq.sdk.model.core.oauth_response_type import OauthResponseType | ||
from bunq.sdk.model.generated.endpoint import OauthClient | ||
from tests.bunq_test import BunqSdkTestCase | ||
|
||
|
||
class TestOauthAuthorizationUri(BunqSdkTestCase): | ||
_TEST_EXPECT_URI = 'https://oauth.sandbox.bunq.com/auth?redirect_uri=redirecturi&response_type=code&state=state' | ||
_TEST_REDIRECT_URI = 'redirecturi' | ||
_TEST_STATUS = 'status' | ||
_TEST_STATE = 'state' | ||
|
||
@classmethod | ||
def setUpClass(cls) -> None: | ||
BunqContext.load_api_context(cls._get_api_context()) | ||
|
||
def test_oauth_authorization_uri_create(self) -> None: | ||
uri = OauthAuthorizationUri.create( | ||
OauthResponseType(OauthResponseType.CODE), | ||
self._TEST_REDIRECT_URI, | ||
OauthClient(self._TEST_STATUS), | ||
self._TEST_STATE | ||
).get_authorization_uri() | ||
|
||
self.assertEqual(self._TEST_EXPECT_URI, uri) |