-
Notifications
You must be signed in to change notification settings - Fork 40
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
fix(Enterprise Management): update service after recent API changes and add examples #102
Conversation
Codecov Report
@@ Coverage Diff @@
## main #102 +/- ##
=======================================
Coverage 93.65% 93.65%
=======================================
Files 22 22
Lines 20641 20641
=======================================
Hits 19332 19332
Misses 1309 1309
Continue to review full report at Codecov.
|
|
||
create_account_group_response = enterprise_management_service.create_account_group( | ||
parent=parent, | ||
name=first_account_group_name, |
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.
name=first_account_group_name, | |
name='Example Account Group', |
global first_account_group_id | ||
first_account_group_id = create_account_group_response.get('account_group_id') | ||
|
||
create_second_account_group_response = enterprise_management_service.create_account_group( |
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.
formatting issues?
enterprise_account_iam_id = None | ||
|
||
account_id = None | ||
first_account_group_id = None |
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.
first_account_group_id = None | |
account_group_id = None |
|
||
account_id = None | ||
first_account_group_id = None | ||
second_account_group_id = None |
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.
second_account_group_id = None | |
new_parent_account_group_id = None |
# end-create_account_group | ||
|
||
global first_account_group_id | ||
first_account_group_id = create_account_group_response.get('account_group_id') |
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.
first_account_group_id = create_account_group_response.get('account_group_id') | |
account_group_id = create_account_group_response.get('account_group_id') |
|
||
response = enterprise_management_service.update_enterprise( | ||
enterprise_id=enterprise_id, | ||
name=updated_enterprise_name, |
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.
name=updated_enterprise_name, | |
name='Updated Example Enterprise', |
list_account_groups_response = list_account_groups_response.get_result() | ||
assert list_account_groups_response is not None | ||
|
||
results_count += 1 |
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.
results_count += 1 | |
results_count += list_account_groups_response.get('rows_count') |
Yes, on the surface, this is equivalent to just incrementing the count by 1, but if we ever change limit, then you're innoculated :)
example_account_id = create_account_response.get('account_id') | ||
|
||
@needscredentials | ||
def test_list_accounts(self): |
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.
for list operations, I think testing the operation with pagination is sufficient since the "without pagination" scenario is a subset of the "with pagination" scenario.
assert update_account_response.get_status_code() == 202 | ||
|
||
@needscredentials | ||
def test_list_enterprises(self): |
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.
Need to add pagination to this test
second_example_account_group_id = create_second_example_account_group_response.get('account_group_id') | ||
|
||
@needscredentials | ||
def test_list_account_groups(self): |
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.
we can remove this "without pagination" test
|
||
response = enterprise_management_service.update_enterprise( | ||
enterprise_id=enterprise_id, | ||
name='Updated Enterprise Name', |
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.
name='Updated Enterprise Name', | |
name='Updated Example Enterprise', |
Check are the created resource IDs in the results of the list operations.
## [0.18.5](v0.18.4...v0.18.5) (2021-04-13) ### Bug Fixes * **Enterprise Management:** update service after recent API changes and add examples ([#102](#102)) ([6eaa326](6eaa326))
🎉 This PR is included in version 0.18.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
PR summary
This PR updates the Enterprise Management service after recent API changes. Also adds working examples.
PR Checklist
Please make sure that your PR fulfills the following requirements:
Current vs new behavior
Does this PR introduce a breaking change?
Other information