MCPcopy
hub / github.com/aws/aws-cli / config_with_profile

Function config_with_profile

tests/integration/customizations/s3/test_plugin.py:65–77  ·  view source on GitHub ↗
(session, files)

Source from the content-addressed store, hash-verified

63
64@pytest.fixture
65def config_with_profile(session, files):
66 config_file = os.path.join(files.rootdir, 'tmpconfig')
67 with open(config_file, 'w') as f:
68 creds = session.get_credentials()
69 f.write(
70 "[profile testprofile]\n"
71 "aws_access_key_id=%s\n"
72 "aws_secret_access_key=%s\n" % (creds.access_key, creds.secret_key)
73 )
74 if creds.token is not None:
75 f.write("aws_session_token=%s\n" % creds.token)
76 f.flush()
77 yield config_file
78
79
80@pytest.fixture

Callers

nothing calls this directly

Calls 3

get_credentialsMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected