-
Notifications
You must be signed in to change notification settings - Fork 62
Data plane multiapi #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Data plane multiapi #693
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2335368
remove hardcoding of managment.azure.com as base_url default, make mu…
iscai-msft 5dce98d
remove assumption of credential param in multiapi service client
iscai-msft 5207ba7
add data plane multiapi
iscai-msft f2e85f7
remove passing of credential and config to multiapi service client super
iscai-msft 9a1266b
add data plane multiapi test
iscai-msft d65a308
fix multiapi base url in testserver, regenerate
iscai-msft 1d41a3c
update changelog
iscai-msft 56cf283
Merge branch 'autorestv3' of https://github.com/Azure/autorest.python…
iscai-msft 3268771
update package.json
iscai-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
77 changes: 77 additions & 0 deletions
77
test/multiapi/AcceptanceTests/asynctests/test_multiapi_data_plane.py
This file contains hidden or 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,77 @@ | ||
| # -------------------------------------------------------------------------- | ||
| # | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # | ||
| # The MIT License (MIT) | ||
| # | ||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # of this software and associated documentation files (the ""Software""), to | ||
| # deal in the Software without restriction, including without limitation the | ||
| # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| # sell copies of the Software, and to permit persons to whom the Software is | ||
| # furnished to do so, subject to the following conditions: | ||
| # | ||
| # The above copyright notice and this permission notice shall be included in | ||
| # all copies or substantial portions of the Software. | ||
| # | ||
| # THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
| # IN THE SOFTWARE. | ||
| # | ||
| # -------------------------------------------------------------------------- | ||
| from async_generator import yield_, async_generator | ||
| import pytest | ||
| import inspect | ||
| import json | ||
| from azure.profiles import KnownProfiles | ||
| from azure.core import AsyncPipelineClient | ||
| from .multiapi_base import NotTested | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| @async_generator | ||
| async def default_client(credential, authentication_policy): | ||
| from multiapidataplane.aio import MultiapiServiceClient | ||
| async with MultiapiServiceClient( | ||
| base_url="http://localhost:3000", | ||
| credential=credential, | ||
| authentication_policy=authentication_policy | ||
| ) as default_client: | ||
| await yield_(default_client) | ||
|
|
||
| @pytest.fixture | ||
| @async_generator | ||
| async def client(credential, authentication_policy, api_version): | ||
| from multiapidataplane.aio import MultiapiServiceClient | ||
|
|
||
| async with MultiapiServiceClient( | ||
| base_url="http://localhost:3000", | ||
| api_version=api_version, | ||
| credential=credential, | ||
| authentication_policy=authentication_policy | ||
| ) as client: | ||
| await yield_(client) | ||
|
|
||
| @pytest.fixture | ||
| def namespace_models(): | ||
| from multiapidataplane import models | ||
| return models | ||
|
|
||
| @pytest.mark.parametrize('api_version', ["2.0.0"]) | ||
| def test_specify_api_version_multiapi_client(client): | ||
| assert client.profile.label == "multiapidataplane.MultiapiServiceClient 2.0.0" | ||
|
|
||
| def test_configuration_kwargs(default_client): | ||
| # making sure that the package name is correct in the sdk moniker | ||
| assert default_client._config.user_agent_policy._user_agent.startswith("azsdk-python-multiapidataplane/") | ||
|
|
||
| def test_pipeline_client(default_client): | ||
| # assert the pipeline client is AsyncPipelineClient from azure.core, since this is data plane | ||
| assert type(default_client._client) == AsyncPipelineClient | ||
|
|
||
| class TestMultiapiClient(NotTested.TestMultiapiBase): | ||
| pass |
This file contains hidden or 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 hidden or 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,76 @@ | ||
| # -------------------------------------------------------------------------- | ||
| # | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # | ||
| # The MIT License (MIT) | ||
| # | ||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # of this software and associated documentation files (the ""Software""), to | ||
| # deal in the Software without restriction, including without limitation the | ||
| # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| # sell copies of the Software, and to permit persons to whom the Software is | ||
| # furnished to do so, subject to the following conditions: | ||
| # | ||
| # The above copyright notice and this permission notice shall be included in | ||
| # all copies or substantial portions of the Software. | ||
| # | ||
| # THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
| # IN THE SOFTWARE. | ||
| # | ||
| # -------------------------------------------------------------------------- | ||
| import pytest | ||
| import inspect | ||
| import json | ||
| from azure.profiles import KnownProfiles | ||
| from azure.core import PipelineClient | ||
| from .multiapi_base import NotTested | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def default_client(credential, authentication_policy): | ||
| from multiapidataplane import MultiapiServiceClient | ||
| with MultiapiServiceClient( | ||
| base_url="http://localhost:3000", | ||
| credential=credential, | ||
| authentication_policy=authentication_policy | ||
| ) as default_client: | ||
| yield default_client | ||
|
|
||
| @pytest.fixture | ||
| def client(credential, authentication_policy, api_version): | ||
| from multiapidataplane import MultiapiServiceClient | ||
|
|
||
| with MultiapiServiceClient( | ||
| base_url="http://localhost:3000", | ||
| api_version=api_version, | ||
| credential=credential, | ||
| authentication_policy=authentication_policy | ||
| ) as client: | ||
| yield client | ||
|
|
||
| @pytest.fixture | ||
| def namespace_models(): | ||
| from multiapidataplane import models | ||
| return models | ||
|
|
||
|
|
||
| @pytest.mark.parametrize('api_version', ["2.0.0"]) | ||
| def test_specify_api_version_multiapi_client(client): | ||
| assert client.profile.label == "multiapidataplane.MultiapiServiceClient 2.0.0" | ||
|
|
||
| def test_configuration_kwargs(default_client): | ||
| # making sure that the package name is correct in the sdk moniker | ||
| assert default_client._config.user_agent_policy._user_agent.startswith("azsdk-python-multiapidataplane/") | ||
|
|
||
| def test_pipeline_client(default_client): | ||
| # assert the pipeline client is PipelineClient from azure.core, since this is data plane | ||
| assert type(default_client._client) == PipelineClient | ||
|
|
||
| class TestMultiapiClient(NotTested.TestMultiapiBase): | ||
| pass | ||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for these mgmt changes in the old multiapi generation, is because I incorrectly had the flag as
azure, and have fixed it to beazure-arm