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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user