[Key Vault] Add ID parsing method for keys#15044
Merged
mccoyp merged 7 commits intoAzure:masterfrom Nov 7, 2020
Merged
Conversation
iscai-msft
previously approved these changes
Nov 6, 2020
chlowell
reviewed
Nov 6, 2020
| **kwargs | ||
| ) | ||
| return UnwrapResult(key_id=self._key_id, algorithm=algorithm, key=operation_result.result) | ||
| return UnwrapResult(key_id=self._key_id.source_id, algorithm=algorithm, key=operation_result.result) |
Member
There was a problem hiding this comment.
Suggested change
| return UnwrapResult(key_id=self._key_id.source_id, algorithm=algorithm, key=operation_result.result) | |
| return UnwrapResult(key_id=self.key_id, algorithm=algorithm, key=operation_result.result) |
| print(parsed_key_id.version) | ||
| print(parsed_key_id.source_id) | ||
| # [END parse_key_vault_key_id] | ||
| self.assertEqual(parsed_key_id.name, key_name) |
Member
There was a problem hiding this comment.
New tests should use assert instead of unittest.TestCase assertions:
Suggested change
| self.assertEqual(parsed_key_id.name, key_name) | |
| assert parsed_key_id.name == key_name |
sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/__init__.py
Show resolved
Hide resolved
| from _shared.test_case import KeyVaultTestCase | ||
|
|
||
| # pre-apply the client_cls positional argument so it needn't be explicitly passed below | ||
| KeyVaultClientPreparer = functools.partial(_KeyVaultClientPreparer, KeyClient) |
Member
There was a problem hiding this comment.
Nitpicking, but this isn't really an improvement because this module only uses the preparer once.
Co-authored-by: Charles Lowell <chlowe@microsoft.com>
chlowell
approved these changes
Nov 7, 2020
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of fix to #13006.
Merged implementation for certificates: #14518.