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

Method create_file_with_size

awscli/testutils.py:638–644  ·  view source on GitHub ↗
(self, filename, filesize)

Source from the content-addressed store, hash-verified

636 return full_path
637
638 def create_file_with_size(self, filename, filesize):
639 filename = self.create_file(filename, contents='')
640 chunksize = 8192
641 with open(filename, 'wb') as f:
642 for i in range(int(math.ceil(filesize / float(chunksize)))):
643 f.write(b'a' * chunksize)
644 return filename
645
646 def append_file(self, filename, contents, encoding=None):
647 """Append contents to a file

Callers

nothing calls this directly

Calls 2

create_fileMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected