Skip to content

Commit ba6cdde

Browse files
authored
fix: pin black version and fix formatting (#239)
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 <[email protected]>
1 parent 4155bc4 commit ba6cdde

11 files changed

+119
-118
lines changed

ibm_platform_services/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""
22
Version of platform_services
33
"""
4+
45
__version__ = '0.49.0'

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ pylint>=3.0.0,<4.0.0
33
pytest>=7.4.2,<8.0.0
44
pytest-cov>=4.1.0,<5.0.0
55
responses>=0.23.3,<1.0.0
6-
black>=23.9.1
6+
black>=24.0.0,<25.0.0

test/unit/test_catalog_management_v1.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8335,9 +8335,9 @@ def test_accumulated_filters_serialization(self):
83358335
accumulated_filters_catalog_filters_item_catalog_model['name'] = 'testString'
83368336

83378337
accumulated_filters_catalog_filters_item_model = {} # AccumulatedFiltersCatalogFiltersItem
8338-
accumulated_filters_catalog_filters_item_model[
8339-
'catalog'
8340-
] = accumulated_filters_catalog_filters_item_catalog_model
8338+
accumulated_filters_catalog_filters_item_model['catalog'] = (
8339+
accumulated_filters_catalog_filters_item_catalog_model
8340+
)
83418341
accumulated_filters_catalog_filters_item_model['filters'] = filters_model
83428342

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

83968396
# Construct a json representation of a AccumulatedFiltersCatalogFiltersItem model
83978397
accumulated_filters_catalog_filters_item_model_json = {}
8398-
accumulated_filters_catalog_filters_item_model_json[
8399-
'catalog'
8400-
] = accumulated_filters_catalog_filters_item_catalog_model
8398+
accumulated_filters_catalog_filters_item_model_json['catalog'] = (
8399+
accumulated_filters_catalog_filters_item_catalog_model
8400+
)
84018401
accumulated_filters_catalog_filters_item_model_json['filters'] = filters_model
84028402

84038403
# Construct a model instance of AccumulatedFiltersCatalogFiltersItem by calling from_dict on the json representation

test/unit/test_enterprise_billing_units_v1.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,9 @@ def test_billing_unit_serialization(self):
752752
# Construct a json representation of a BillingUnit model
753753
billing_unit_model_json = {}
754754
billing_unit_model_json['id'] = 'testString'
755-
billing_unit_model_json[
756-
'crn'
757-
] = 'crn:v1:bluemix:public:billing::a/<<enterprise_account_id>>::billing-unit:<<billing_unit_id>>'
755+
billing_unit_model_json['crn'] = (
756+
'crn:v1:bluemix:public:billing::a/<<enterprise_account_id>>::billing-unit:<<billing_unit_id>>'
757+
)
758758
billing_unit_model_json['name'] = 'testString'
759759
billing_unit_model_json['enterprise_id'] = 'testString'
760760
billing_unit_model_json['currency_code'] = 'USD'
@@ -792,9 +792,9 @@ def test_billing_units_list_serialization(self):
792792

793793
billing_unit_model = {} # BillingUnit
794794
billing_unit_model['id'] = '$BILLING_UNIT_ID'
795-
billing_unit_model[
796-
'crn'
797-
] = 'crn:v1:bluemix:public:billing::a/$ENTERPRISE_ACCOUNT_ID::billing-unit:$BILLING_UNIT_ID'
795+
billing_unit_model['crn'] = (
796+
'crn:v1:bluemix:public:billing::a/$ENTERPRISE_ACCOUNT_ID::billing-unit:$BILLING_UNIT_ID'
797+
)
798798
billing_unit_model['name'] = 'Sample Billing Unit'
799799
billing_unit_model['enterprise_id'] = '$ENTERPRISE_ID'
800800
billing_unit_model['currency_code'] = 'USD'

test/unit/test_enterprise_usage_reports_v1.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,9 @@ def test_reports_serialization(self):
376376
# Construct dict forms of any model objects needed in order to build this model.
377377

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

383383
metric_usage_model = {} # MetricUsage
384384
metric_usage_model['metric'] = 'GB_STORAGE_ACCRUED_PER_MONTH'
@@ -409,14 +409,14 @@ def test_reports_serialization(self):
409409
resource_usage_report_model = {} # ResourceUsageReport
410410
resource_usage_report_model['entity_id'] = '41848d0e2711434bbc134242452f7fc7'
411411
resource_usage_report_model['entity_type'] = 'account'
412-
resource_usage_report_model[
413-
'entity_crn'
414-
] = 'crn:v1:bluemix:public:enterprise::a/3f99f8accbc848ea96f3c61a0ae22c44::account:41848d0e2711434bbc134242452f7fc7'
412+
resource_usage_report_model['entity_crn'] = (
413+
'crn:v1:bluemix:public:enterprise::a/3f99f8accbc848ea96f3c61a0ae22c44::account:41848d0e2711434bbc134242452f7fc7'
414+
)
415415
resource_usage_report_model['entity_name'] = 'Example Account'
416416
resource_usage_report_model['billing_unit_id'] = '65719a07280a4022a9efa2f6ff4c3369'
417-
resource_usage_report_model[
418-
'billing_unit_crn'
419-
] = 'crn:v1:bluemix:public:billing::a/3f99f8accbc848ea96f3c61a0ae22c44::billing-unit:65719a07280a4022a9efa2f6ff4c3369'
417+
resource_usage_report_model['billing_unit_crn'] = (
418+
'crn:v1:bluemix:public:billing::a/3f99f8accbc848ea96f3c61a0ae22c44::billing-unit:65719a07280a4022a9efa2f6ff4c3369'
419+
)
420420
resource_usage_report_model['billing_unit_name'] = 'Example Billing Unit'
421421
resource_usage_report_model['country_code'] = 'USA'
422422
resource_usage_report_model['currency_code'] = 'USD'
@@ -547,14 +547,14 @@ def test_resource_usage_report_serialization(self):
547547
resource_usage_report_model_json = {}
548548
resource_usage_report_model_json['entity_id'] = 'de129b787b86403db7d3a14be2ae5f76'
549549
resource_usage_report_model_json['entity_type'] = 'enterprise'
550-
resource_usage_report_model_json[
551-
'entity_crn'
552-
] = 'crn:v1:bluemix:public:enterprise::a/e9a57260546c4b4aa9ebfa316a82e56e::enterprise:de129b787b86403db7d3a14be2ae5f76'
550+
resource_usage_report_model_json['entity_crn'] = (
551+
'crn:v1:bluemix:public:enterprise::a/e9a57260546c4b4aa9ebfa316a82e56e::enterprise:de129b787b86403db7d3a14be2ae5f76'
552+
)
553553
resource_usage_report_model_json['entity_name'] = 'Platform-Services'
554554
resource_usage_report_model_json['billing_unit_id'] = '65719a07280a4022a9efa2f6ff4c3369'
555-
resource_usage_report_model_json[
556-
'billing_unit_crn'
557-
] = 'crn:v1:bluemix:public:billing::a/3f99f8accbc848ea96f3c61a0ae22c44::billing-unit:65719a07280a4022a9efa2f6ff4c3369'
555+
resource_usage_report_model_json['billing_unit_crn'] = (
556+
'crn:v1:bluemix:public:billing::a/3f99f8accbc848ea96f3c61a0ae22c44::billing-unit:65719a07280a4022a9efa2f6ff4c3369'
557+
)
558558
resource_usage_report_model_json['billing_unit_name'] = 'Operations'
559559
resource_usage_report_model_json['country_code'] = 'USA'
560560
resource_usage_report_model_json['currency_code'] = 'USD'

test/unit/test_global_tagging_v1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,9 +1259,9 @@ def test_tag_results_serialization(self):
12591259
# Construct dict forms of any model objects needed in order to build this model.
12601260

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

12671267
# Construct a json representation of a TagResults model

test/unit/test_iam_access_groups_v2.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3120,9 +3120,9 @@ def test_create_template_all_params(self):
31203120
# Construct a dict representation of a AccessGroupRequest model
31213121
access_group_request_model = {}
31223122
access_group_request_model['name'] = 'IAM Admin Group'
3123-
access_group_request_model[
3124-
'description'
3125-
] = 'This access group template allows admin access to all IAM platform services in the account.'
3123+
access_group_request_model['description'] = (
3124+
'This access group template allows admin access to all IAM platform services in the account.'
3125+
)
31263126
access_group_request_model['members'] = members_model
31273127
access_group_request_model['assertions'] = assertions_model
31283128
access_group_request_model['action_controls'] = group_action_controls_model
@@ -3240,9 +3240,9 @@ def test_create_template_required_params(self):
32403240
# Construct a dict representation of a AccessGroupRequest model
32413241
access_group_request_model = {}
32423242
access_group_request_model['name'] = 'IAM Admin Group'
3243-
access_group_request_model[
3244-
'description'
3245-
] = 'This access group template allows admin access to all IAM platform services in the account.'
3243+
access_group_request_model['description'] = (
3244+
'This access group template allows admin access to all IAM platform services in the account.'
3245+
)
32463246
access_group_request_model['members'] = members_model
32473247
access_group_request_model['assertions'] = assertions_model
32483248
access_group_request_model['action_controls'] = group_action_controls_model
@@ -3358,9 +3358,9 @@ def test_create_template_value_error(self):
33583358
# Construct a dict representation of a AccessGroupRequest model
33593359
access_group_request_model = {}
33603360
access_group_request_model['name'] = 'IAM Admin Group'
3361-
access_group_request_model[
3362-
'description'
3363-
] = 'This access group template allows admin access to all IAM platform services in the account.'
3361+
access_group_request_model['description'] = (
3362+
'This access group template allows admin access to all IAM platform services in the account.'
3363+
)
33643364
access_group_request_model['members'] = members_model
33653365
access_group_request_model['assertions'] = assertions_model
33663366
access_group_request_model['action_controls'] = group_action_controls_model
@@ -3681,9 +3681,9 @@ def test_create_template_version_all_params(self):
36813681
# Construct a dict representation of a AccessGroupRequest model
36823682
access_group_request_model = {}
36833683
access_group_request_model['name'] = 'IAM Admin Group 8'
3684-
access_group_request_model[
3685-
'description'
3686-
] = 'This access group template allows admin access to all IAM platform services in the account.'
3684+
access_group_request_model['description'] = (
3685+
'This access group template allows admin access to all IAM platform services in the account.'
3686+
)
36873687
access_group_request_model['members'] = members_model
36883688
access_group_request_model['assertions'] = assertions_model
36893689
access_group_request_model['action_controls'] = group_action_controls_model
@@ -4213,9 +4213,9 @@ def test_update_template_version_all_params(self):
42134213
# Construct a dict representation of a AccessGroupRequest model
42144214
access_group_request_model = {}
42154215
access_group_request_model['name'] = 'IAM Admin Group 8'
4216-
access_group_request_model[
4217-
'description'
4218-
] = 'This access group template allows admin access to all IAM platform services in the account.'
4216+
access_group_request_model['description'] = (
4217+
'This access group template allows admin access to all IAM platform services in the account.'
4218+
)
42194219
access_group_request_model['members'] = members_model
42204220
access_group_request_model['assertions'] = assertions_model
42214221
access_group_request_model['action_controls'] = group_action_controls_model

test/unit/test_iam_identity_v1.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9770,9 +9770,9 @@ def test_template_assignment_list_response_serialization(self):
97709770
template_assignment_response_resource_model = {} # TemplateAssignmentResponseResource
97719771
template_assignment_response_resource_model['target'] = 'testString'
97729772
template_assignment_response_resource_model['profile'] = template_assignment_response_resource_detail_model
9773-
template_assignment_response_resource_model[
9774-
'account_settings'
9775-
] = template_assignment_response_resource_detail_model
9773+
template_assignment_response_resource_model['account_settings'] = (
9774+
template_assignment_response_resource_detail_model
9775+
)
97769776
template_assignment_response_resource_model['policy_template_refs'] = [
97779777
template_assignment_response_resource_detail_model
97789778
]
@@ -9952,9 +9952,9 @@ def test_template_assignment_response_serialization(self):
99529952
template_assignment_response_resource_model = {} # TemplateAssignmentResponseResource
99539953
template_assignment_response_resource_model['target'] = 'testString'
99549954
template_assignment_response_resource_model['profile'] = template_assignment_response_resource_detail_model
9955-
template_assignment_response_resource_model[
9956-
'account_settings'
9957-
] = template_assignment_response_resource_detail_model
9955+
template_assignment_response_resource_model['account_settings'] = (
9956+
template_assignment_response_resource_detail_model
9957+
)
99589958
template_assignment_response_resource_model['policy_template_refs'] = [
99599959
template_assignment_response_resource_detail_model
99609960
]
@@ -10038,9 +10038,9 @@ def test_template_assignment_response_resource_serialization(self):
1003810038
template_assignment_response_resource_model_json = {}
1003910039
template_assignment_response_resource_model_json['target'] = 'testString'
1004010040
template_assignment_response_resource_model_json['profile'] = template_assignment_response_resource_detail_model
10041-
template_assignment_response_resource_model_json[
10042-
'account_settings'
10043-
] = template_assignment_response_resource_detail_model
10041+
template_assignment_response_resource_model_json['account_settings'] = (
10042+
template_assignment_response_resource_detail_model
10043+
)
1004410044
template_assignment_response_resource_model_json['policy_template_refs'] = [
1004510045
template_assignment_response_resource_detail_model
1004610046
]
@@ -10093,9 +10093,9 @@ def test_template_assignment_response_resource_detail_serialization(self):
1009310093
template_assignment_response_resource_detail_model_json['id'] = 'testString'
1009410094
template_assignment_response_resource_detail_model_json['version'] = 'testString'
1009510095
template_assignment_response_resource_detail_model_json['resource_created'] = template_assignment_resource_model
10096-
template_assignment_response_resource_detail_model_json[
10097-
'error_message'
10098-
] = template_assignment_resource_error_model
10096+
template_assignment_response_resource_detail_model_json['error_message'] = (
10097+
template_assignment_resource_error_model
10098+
)
1009910099
template_assignment_response_resource_detail_model_json['status'] = 'testString'
1010010100

1010110101
# Construct a model instance of TemplateAssignmentResponseResourceDetail by calling from_dict on the json representation

test/unit/test_resource_controller_v2.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,9 +1364,9 @@ def test_create_resource_key_all_params(self):
13641364

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

13721372
# Set up parameter values
@@ -1409,9 +1409,9 @@ def test_create_resource_key_value_error(self):
14091409

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

14171417
# Set up parameter values
@@ -1849,9 +1849,9 @@ def test_create_resource_binding_all_params(self):
18491849

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

18571857
# Set up parameter values
@@ -1901,9 +1901,9 @@ def test_create_resource_binding_value_error(self):
19011901

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

19091909
# Set up parameter values
@@ -3374,9 +3374,9 @@ def test_resource_binding_post_parameters_serialization(self):
33743374

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

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

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

37943794
# Construct a model instance of ResourceKeyPostParameters by calling from_dict on the json representation

0 commit comments

Comments
 (0)