Write *content* to a file located at *path*. If *path* is a tuple instead of a string, os.path.join will be used to make a path.
(path, content=b'')
| 69 | return wrap |
| 70 | |
| 71 | def create_file(path, content=b''): |
| 72 | """Write *content* to a file located at *path*. |
| 73 | |
| 74 | If *path* is a tuple instead of a string, os.path.join will be used to |
| 75 | make a path. |
| 76 | """ |
| 77 | if isinstance(path, tuple): |
| 78 | path = os.path.join(*path) |
| 79 | if isinstance(content, str): |
| 80 | content = content.encode() |
| 81 | with open(path, 'xb') as fp: |
| 82 | fp.write(content) |
| 83 | |
| 84 | def write_test_file(path, size): |
| 85 | """Create a test file with an arbitrary size and random text content.""" |
no test coverage detected
searching dependent graphs…