Skip to content

Commit 2dd1346

Browse files
committed
chore: update comments in examples
1 parent df26182 commit 2dd1346

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

examples/test_iam_policy_management_v1_examples.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@
2323
from ibm_platform_services.iam_policy_management_v1 import *
2424

2525
#
26-
# Below are examples on how to use IAM Policy Management service
26+
# This file provides an example of how to use the IAM Policy Management service.
2727
#
28-
# The following environment variables are assumed to be defined when running examples below:
28+
# The following configuration properties are assumed to be defined:
2929
#
30-
# IAM_POLICY_MANAGEMENT_URL=https://iam.cloud.ibm.com
30+
# IAM_POLICY_MANAGEMENT_URL=<service url>
3131
# IAM_POLICY_MANAGEMENT_AUTH_TYPE=iam
32-
# IAM_POLICY_MANAGEMENT_AUTH_URL=https://iam.cloud.ibm.com/identity/token
33-
# IAM_POLICY_MANAGEMENT_APIKEY= <YOUR_APIKEY>
34-
# IAM_POLICY_MANAGEMENT_TEST_ACCOUNT_ID= <YOUR_ACCOUNT_ID>
32+
# IAM_POLICY_MANAGEMENT_AUTH_URL=<IAM token service URL - omit this if using the production environment>
33+
# IAM_POLICY_MANAGEMENT_APIKEY=<YOUR_APIKEY>
34+
# IAM_POLICY_MANAGEMENT_TEST_ACCOUNT_ID=<YOUR_ACCOUNT_ID>
3535
#
36-
# Alternatively, above environment variables can be placed in a "credentials" file and then:
37-
# export IBM_CREDENTIALS_FILE=<name of credentials file>
36+
# These configuration properties can be exported as environment variables, or stored
37+
# in a configuration file and then:
38+
# export IBM_CREDENTIALS_FILE=<name of config file>
3839
#
39-
4040
# Config file name
4141
config_file = 'iam_policy_management.env'
4242

@@ -56,6 +56,8 @@
5656
# Start of Examples for Service: IamPolicyManagementV1
5757
##############################################################################
5858
# region
59+
60+
5961
class TestIamPolicyManagementV1Examples():
6062
"""
6163
Example Test Class for IamPolicyManagementV1
@@ -77,7 +79,8 @@ def setup_class(cls):
7779

7880
# Load the configuration
7981
global config, example_account_id
80-
config = read_external_sources(IamPolicyManagementV1.DEFAULT_SERVICE_NAME)
82+
config = read_external_sources(
83+
IamPolicyManagementV1.DEFAULT_SERVICE_NAME)
8184
example_account_id = config['TEST_ACCOUNT_ID']
8285

8386
print('Setup complete.')
@@ -103,7 +106,8 @@ def test_create_policy_example(self):
103106
name='accountId', value=example_account_id)
104107
service_name_resource_attribute = ResourceAttribute(
105108
name='serviceName', value=example_service_name)
106-
policy_resource_tag = ResourceTag(name='project', value='prototype')
109+
policy_resource_tag = ResourceTag(
110+
name='project', value='prototype')
107111
policy_resources = PolicyResource(
108112
attributes=[account_id_resource_attribute,
109113
service_name_resource_attribute],
@@ -160,7 +164,8 @@ def test_update_policy_example(self):
160164
name='accountId', value=example_account_id)
161165
service_name_resource_attribute = ResourceAttribute(
162166
name='serviceName', value=example_service_name)
163-
policy_resource_tag = ResourceTag(name='project', value='prototype')
167+
policy_resource_tag = ResourceTag(
168+
name='project', value='prototype')
164169
policy_resources = PolicyResource(
165170
attributes=[account_id_resource_attribute,
166171
service_name_resource_attribute],
@@ -277,7 +282,8 @@ def test_update_role_example(self):
277282
try:
278283
# begin-update_role
279284

280-
updated_role_actions = ['iam-groups.groups.read', 'iam-groups.groups.list']
285+
updated_role_actions = [
286+
'iam-groups.groups.read', 'iam-groups.groups.list']
281287
custom_role = iam_policy_management_service.update_role(
282288
role_id=example_custom_role_id,
283289
if_match=example_custom_role_etag,

0 commit comments

Comments
 (0)