1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-12 22:45:13 +00:00

update tests and improve

This commit is contained in:
deadc0de6
2018-09-25 08:51:56 +02:00
parent 8d60e0ca5c
commit 3819511e72
5 changed files with 36 additions and 24 deletions

View File

@@ -55,6 +55,15 @@ def create_random_file(directory, content=None, binary=False):
return path, content
def edit_content(path, newcontent, binary=False):
'''edit file content'''
mode = 'w'
if binary:
mode = 'wb'
with open(path, mode) as f:
f.write(newcontent)
def create_dir(path):
'''Create a directory'''
if not os.path.exists(path):