MCPcopy Index your code
hub / github.com/aws/aws-cli / test_user_data

Method test_user_data

tests/functional/ec2/test_run_instances.py:39–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 self.assert_run_instances_call(args, result)
38
39 def test_user_data(self):
40 data = '\u0039'
41 with temporary_file('r+') as tmp:
42 with compat_open(tmp.name, 'w') as f:
43 f.write(data)
44 f.flush()
45 args = ' --image-id foo --user-data file://%s' % f.name
46 result = {
47 'ImageId': 'foo',
48 'MaxCount': 1,
49 'MinCount': 1,
50 # base64 encoded content of utf-8 encoding of data.
51 'UserData': 'OQ==',
52 }
53 self.assert_run_instances_call(args, result)
54
55 def test_count_range(self):
56 args = ' --image-id ami-foobar --count 5:10'

Callers

nothing calls this directly

Calls 5

temporary_fileFunction · 0.90
compat_openFunction · 0.90
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected