Skip to content

Commit

Permalink
fix: pin black version and fix formatting (#239)
Browse files Browse the repository at this point in the history
A new version of black was recently pulled into Travis builds
and caused some lint-related errors because of some slight
differences in the code formatting output.
This commit pins the version of black used in our builds
to v24.x.x and fixes the handful of existing formatting-related
problems identified by this new version of black.

Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
  • Loading branch information
padamstx authored Jan 30, 2024
1 parent 4155bc4 commit ba6cdde
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 118 deletions.
1 change: 1 addition & 0 deletions ibm_platform_services/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""
Version of platform_services
"""

__version__ = '0.49.0'
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pylint>=3.0.0,<4.0.0
pytest>=7.4.2,<8.0.0
pytest-cov>=4.1.0,<5.0.0
responses>=0.23.3,<1.0.0
black>=23.9.1
black>=24.0.0,<25.0.0
12 changes: 6 additions & 6 deletions test/unit/test_catalog_management_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8335,9 +8335,9 @@ def test_accumulated_filters_serialization(self):
accumulated_filters_catalog_filters_item_catalog_model['name'] = 'testString'

accumulated_filters_catalog_filters_item_model = {} # AccumulatedFiltersCatalogFiltersItem
accumulated_filters_catalog_filters_item_model[
'catalog'
] = accumulated_filters_catalog_filters_item_catalog_model
accumulated_filters_catalog_filters_item_model['catalog'] = (
accumulated_filters_catalog_filters_item_catalog_model
)
accumulated_filters_catalog_filters_item_model['filters'] = filters_model

# Construct a json representation of a AccumulatedFilters model
Expand Down Expand Up @@ -8395,9 +8395,9 @@ def test_accumulated_filters_catalog_filters_item_serialization(self):

# Construct a json representation of a AccumulatedFiltersCatalogFiltersItem model
accumulated_filters_catalog_filters_item_model_json = {}
accumulated_filters_catalog_filters_item_model_json[
'catalog'
] = accumulated_filters_catalog_filters_item_catalog_model
accumulated_filters_catalog_filters_item_model_json['catalog'] = (
accumulated_filters_catalog_filters_item_catalog_model
)
accumulated_filters_catalog_filters_item_model_json['filters'] = filters_model

# Construct a model instance of AccumulatedFiltersCatalogFiltersItem by calling from_dict on the json representation
Expand Down
12 changes: 6 additions & 6 deletions test/unit/test_enterprise_billing_units_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,9 @@ def test_billing_unit_serialization(self):
# Construct a json representation of a BillingUnit model
billing_unit_model_json = {}
billing_unit_model_json['id'] = 'testString'
billing_unit_model_json[
'crn'
] = 'crn:v1:bluemix:public:billing::a/<<enterprise_account_id>>::billing-unit:<<billing_unit_id>>'
billing_unit_model_json['crn'] = (
'crn:v1:bluemix:public:billing::a/<<enterprise_account_id>>::billing-unit:<<billing_unit_id>>'
)
billing_unit_model_json['name'] = 'testString'
billing_unit_model_json['enterprise_id'] = 'testString'
billing_unit_model_json['currency_code'] = 'USD'
Expand Down Expand Up @@ -792,9 +792,9 @@ def test_billing_units_list_serialization(self):

billing_unit_model = {} # BillingUnit
billing_unit_model['id'] = '$BILLING_UNIT_ID'
billing_unit_model[
'crn'
] = 'crn:v1:bluemix:public:billing::a/$ENTERPRISE_ACCOUNT_ID::billing-unit:$BILLING_UNIT_ID'
billing_unit_model['crn'] = (
'crn:v1:bluemix:public:billing::a/$ENTERPRISE_ACCOUNT_ID::billing-unit:$BILLING_UNIT_ID'
)
billing_unit_model['name'] = 'Sample Billing Unit'
billing_unit_model['enterprise_id'] = '$ENTERPRISE_ID'
billing_unit_model['currency_code'] = 'USD'
Expand Down
30 changes: 15 additions & 15 deletions test/unit/test_enterprise_usage_reports_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ def test_reports_serialization(self):
# Construct dict forms of any model objects needed in order to build this model.

link_model = {} # Link
link_model[
'href'
] = '/v1/resource-usage-reports?enterprise_id=5ac9eb23c91b429b893e038aa5a2dec8&children=true&month=2019-06&limit=2'
link_model['href'] = (
'/v1/resource-usage-reports?enterprise_id=5ac9eb23c91b429b893e038aa5a2dec8&children=true&month=2019-06&limit=2'
)

metric_usage_model = {} # MetricUsage
metric_usage_model['metric'] = 'GB_STORAGE_ACCRUED_PER_MONTH'
Expand Down Expand Up @@ -409,14 +409,14 @@ def test_reports_serialization(self):
resource_usage_report_model = {} # ResourceUsageReport
resource_usage_report_model['entity_id'] = '41848d0e2711434bbc134242452f7fc7'
resource_usage_report_model['entity_type'] = 'account'
resource_usage_report_model[
'entity_crn'
] = 'crn:v1:bluemix:public:enterprise::a/3f99f8accbc848ea96f3c61a0ae22c44::account:41848d0e2711434bbc134242452f7fc7'
resource_usage_report_model['entity_crn'] = (
'crn:v1:bluemix:public:enterprise::a/3f99f8accbc848ea96f3c61a0ae22c44::account:41848d0e2711434bbc134242452f7fc7'
)
resource_usage_report_model['entity_name'] = 'Example Account'
resource_usage_report_model['billing_unit_id'] = '65719a07280a4022a9efa2f6ff4c3369'
resource_usage_report_model[
'billing_unit_crn'
] = 'crn:v1:bluemix:public:billing::a/3f99f8accbc848ea96f3c61a0ae22c44::billing-unit:65719a07280a4022a9efa2f6ff4c3369'
resource_usage_report_model['billing_unit_crn'] = (
'crn:v1:bluemix:public:billing::a/3f99f8accbc848ea96f3c61a0ae22c44::billing-unit:65719a07280a4022a9efa2f6ff4c3369'
)
resource_usage_report_model['billing_unit_name'] = 'Example Billing Unit'
resource_usage_report_model['country_code'] = 'USA'
resource_usage_report_model['currency_code'] = 'USD'
Expand Down Expand Up @@ -547,14 +547,14 @@ def test_resource_usage_report_serialization(self):
resource_usage_report_model_json = {}
resource_usage_report_model_json['entity_id'] = 'de129b787b86403db7d3a14be2ae5f76'
resource_usage_report_model_json['entity_type'] = 'enterprise'
resource_usage_report_model_json[
'entity_crn'
] = 'crn:v1:bluemix:public:enterprise::a/e9a57260546c4b4aa9ebfa316a82e56e::enterprise:de129b787b86403db7d3a14be2ae5f76'
resource_usage_report_model_json['entity_crn'] = (
'crn:v1:bluemix:public:enterprise::a/e9a57260546c4b4aa9ebfa316a82e56e::enterprise:de129b787b86403db7d3a14be2ae5f76'
)
resource_usage_report_model_json['entity_name'] = 'Platform-Services'
resource_usage_report_model_json['billing_unit_id'] = '65719a07280a4022a9efa2f6ff4c3369'
resource_usage_report_model_json[
'billing_unit_crn'
] = 'crn:v1:bluemix:public:billing::a/3f99f8accbc848ea96f3c61a0ae22c44::billing-unit:65719a07280a4022a9efa2f6ff4c3369'
resource_usage_report_model_json['billing_unit_crn'] = (
'crn:v1:bluemix:public:billing::a/3f99f8accbc848ea96f3c61a0ae22c44::billing-unit:65719a07280a4022a9efa2f6ff4c3369'
)
resource_usage_report_model_json['billing_unit_name'] = 'Operations'
resource_usage_report_model_json['country_code'] = 'USA'
resource_usage_report_model_json['currency_code'] = 'USD'
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_global_tagging_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,9 +1259,9 @@ def test_tag_results_serialization(self):
# Construct dict forms of any model objects needed in order to build this model.

tag_results_item_model = {} # TagResultsItem
tag_results_item_model[
'resource_id'
] = 'crn:v1:staging:public:resource-controller::a/5c2ac0d93c69e82c6c9c7c78dc4beda3::resource-group:1c061f4485b34360a8f8ee049880dc13'
tag_results_item_model['resource_id'] = (
'crn:v1:staging:public:resource-controller::a/5c2ac0d93c69e82c6c9c7c78dc4beda3::resource-group:1c061f4485b34360a8f8ee049880dc13'
)
tag_results_item_model['is_error'] = False

# Construct a json representation of a TagResults model
Expand Down
30 changes: 15 additions & 15 deletions test/unit/test_iam_access_groups_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3120,9 +3120,9 @@ def test_create_template_all_params(self):
# Construct a dict representation of a AccessGroupRequest model
access_group_request_model = {}
access_group_request_model['name'] = 'IAM Admin Group'
access_group_request_model[
'description'
] = 'This access group template allows admin access to all IAM platform services in the account.'
access_group_request_model['description'] = (
'This access group template allows admin access to all IAM platform services in the account.'
)
access_group_request_model['members'] = members_model
access_group_request_model['assertions'] = assertions_model
access_group_request_model['action_controls'] = group_action_controls_model
Expand Down Expand Up @@ -3240,9 +3240,9 @@ def test_create_template_required_params(self):
# Construct a dict representation of a AccessGroupRequest model
access_group_request_model = {}
access_group_request_model['name'] = 'IAM Admin Group'
access_group_request_model[
'description'
] = 'This access group template allows admin access to all IAM platform services in the account.'
access_group_request_model['description'] = (
'This access group template allows admin access to all IAM platform services in the account.'
)
access_group_request_model['members'] = members_model
access_group_request_model['assertions'] = assertions_model
access_group_request_model['action_controls'] = group_action_controls_model
Expand Down Expand Up @@ -3358,9 +3358,9 @@ def test_create_template_value_error(self):
# Construct a dict representation of a AccessGroupRequest model
access_group_request_model = {}
access_group_request_model['name'] = 'IAM Admin Group'
access_group_request_model[
'description'
] = 'This access group template allows admin access to all IAM platform services in the account.'
access_group_request_model['description'] = (
'This access group template allows admin access to all IAM platform services in the account.'
)
access_group_request_model['members'] = members_model
access_group_request_model['assertions'] = assertions_model
access_group_request_model['action_controls'] = group_action_controls_model
Expand Down Expand Up @@ -3681,9 +3681,9 @@ def test_create_template_version_all_params(self):
# Construct a dict representation of a AccessGroupRequest model
access_group_request_model = {}
access_group_request_model['name'] = 'IAM Admin Group 8'
access_group_request_model[
'description'
] = 'This access group template allows admin access to all IAM platform services in the account.'
access_group_request_model['description'] = (
'This access group template allows admin access to all IAM platform services in the account.'
)
access_group_request_model['members'] = members_model
access_group_request_model['assertions'] = assertions_model
access_group_request_model['action_controls'] = group_action_controls_model
Expand Down Expand Up @@ -4213,9 +4213,9 @@ def test_update_template_version_all_params(self):
# Construct a dict representation of a AccessGroupRequest model
access_group_request_model = {}
access_group_request_model['name'] = 'IAM Admin Group 8'
access_group_request_model[
'description'
] = 'This access group template allows admin access to all IAM platform services in the account.'
access_group_request_model['description'] = (
'This access group template allows admin access to all IAM platform services in the account.'
)
access_group_request_model['members'] = members_model
access_group_request_model['assertions'] = assertions_model
access_group_request_model['action_controls'] = group_action_controls_model
Expand Down
24 changes: 12 additions & 12 deletions test/unit/test_iam_identity_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9770,9 +9770,9 @@ def test_template_assignment_list_response_serialization(self):
template_assignment_response_resource_model = {} # TemplateAssignmentResponseResource
template_assignment_response_resource_model['target'] = 'testString'
template_assignment_response_resource_model['profile'] = template_assignment_response_resource_detail_model
template_assignment_response_resource_model[
'account_settings'
] = template_assignment_response_resource_detail_model
template_assignment_response_resource_model['account_settings'] = (
template_assignment_response_resource_detail_model
)
template_assignment_response_resource_model['policy_template_refs'] = [
template_assignment_response_resource_detail_model
]
Expand Down Expand Up @@ -9952,9 +9952,9 @@ def test_template_assignment_response_serialization(self):
template_assignment_response_resource_model = {} # TemplateAssignmentResponseResource
template_assignment_response_resource_model['target'] = 'testString'
template_assignment_response_resource_model['profile'] = template_assignment_response_resource_detail_model
template_assignment_response_resource_model[
'account_settings'
] = template_assignment_response_resource_detail_model
template_assignment_response_resource_model['account_settings'] = (
template_assignment_response_resource_detail_model
)
template_assignment_response_resource_model['policy_template_refs'] = [
template_assignment_response_resource_detail_model
]
Expand Down Expand Up @@ -10038,9 +10038,9 @@ def test_template_assignment_response_resource_serialization(self):
template_assignment_response_resource_model_json = {}
template_assignment_response_resource_model_json['target'] = 'testString'
template_assignment_response_resource_model_json['profile'] = template_assignment_response_resource_detail_model
template_assignment_response_resource_model_json[
'account_settings'
] = template_assignment_response_resource_detail_model
template_assignment_response_resource_model_json['account_settings'] = (
template_assignment_response_resource_detail_model
)
template_assignment_response_resource_model_json['policy_template_refs'] = [
template_assignment_response_resource_detail_model
]
Expand Down Expand Up @@ -10093,9 +10093,9 @@ def test_template_assignment_response_resource_detail_serialization(self):
template_assignment_response_resource_detail_model_json['id'] = 'testString'
template_assignment_response_resource_detail_model_json['version'] = 'testString'
template_assignment_response_resource_detail_model_json['resource_created'] = template_assignment_resource_model
template_assignment_response_resource_detail_model_json[
'error_message'
] = template_assignment_resource_error_model
template_assignment_response_resource_detail_model_json['error_message'] = (
template_assignment_resource_error_model
)
template_assignment_response_resource_detail_model_json['status'] = 'testString'

# Construct a model instance of TemplateAssignmentResponseResourceDetail by calling from_dict on the json representation
Expand Down
36 changes: 18 additions & 18 deletions test/unit/test_resource_controller_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,9 +1364,9 @@ def test_create_resource_key_all_params(self):

# Construct a dict representation of a ResourceKeyPostParameters model
resource_key_post_parameters_model = {}
resource_key_post_parameters_model[
'serviceid_crn'
] = 'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
resource_key_post_parameters_model['serviceid_crn'] = (
'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
)
resource_key_post_parameters_model['exampleParameter'] = 'exampleValue'

# Set up parameter values
Expand Down Expand Up @@ -1409,9 +1409,9 @@ def test_create_resource_key_value_error(self):

# Construct a dict representation of a ResourceKeyPostParameters model
resource_key_post_parameters_model = {}
resource_key_post_parameters_model[
'serviceid_crn'
] = 'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
resource_key_post_parameters_model['serviceid_crn'] = (
'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
)
resource_key_post_parameters_model['exampleParameter'] = 'exampleValue'

# Set up parameter values
Expand Down Expand Up @@ -1849,9 +1849,9 @@ def test_create_resource_binding_all_params(self):

# Construct a dict representation of a ResourceBindingPostParameters model
resource_binding_post_parameters_model = {}
resource_binding_post_parameters_model[
'serviceid_crn'
] = 'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
resource_binding_post_parameters_model['serviceid_crn'] = (
'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
)
resource_binding_post_parameters_model['exampleParameter'] = 'exampleValue'

# Set up parameter values
Expand Down Expand Up @@ -1901,9 +1901,9 @@ def test_create_resource_binding_value_error(self):

# Construct a dict representation of a ResourceBindingPostParameters model
resource_binding_post_parameters_model = {}
resource_binding_post_parameters_model[
'serviceid_crn'
] = 'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
resource_binding_post_parameters_model['serviceid_crn'] = (
'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
)
resource_binding_post_parameters_model['exampleParameter'] = 'exampleValue'

# Set up parameter values
Expand Down Expand Up @@ -3374,9 +3374,9 @@ def test_resource_binding_post_parameters_serialization(self):

# Construct a json representation of a ResourceBindingPostParameters model
resource_binding_post_parameters_model_json = {}
resource_binding_post_parameters_model_json[
'serviceid_crn'
] = 'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
resource_binding_post_parameters_model_json['serviceid_crn'] = (
'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
)
resource_binding_post_parameters_model_json['foo'] = 'testString'

# Construct a model instance of ResourceBindingPostParameters by calling from_dict on the json representation
Expand Down Expand Up @@ -3786,9 +3786,9 @@ def test_resource_key_post_parameters_serialization(self):

# Construct a json representation of a ResourceKeyPostParameters model
resource_key_post_parameters_model_json = {}
resource_key_post_parameters_model_json[
'serviceid_crn'
] = 'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
resource_key_post_parameters_model_json['serviceid_crn'] = (
'crn:v1:bluemix:public:iam-identity::a/9fceaa56d1ab84893af6b9eec5ab81bb::serviceid:ServiceId-fe4c29b5-db13-410a-bacc-b5779a03d393'
)
resource_key_post_parameters_model_json['foo'] = 'testString'

# Construct a model instance of ResourceKeyPostParameters by calling from_dict on the json representation
Expand Down
Loading

0 comments on commit ba6cdde

Please sign in to comment.