Skip to content

Commit c159494

Browse files
committed
Added file remove function with exception handling
1 parent 1dbeae4 commit c159494

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

workspace_tools/singletest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,17 @@ def file_copy_method_selector(self, image_path, disk, copy_method):
177177
# Default python method
178178
copy(image_path, disk)
179179

180+
def delete_file(file_path):
181+
""" Remove file from the system """
182+
result = True
183+
resutl_msg = ""
184+
try:
185+
os.remove(file_path)
186+
except Exception, e:
187+
resutl_msg = e
188+
result = False
189+
return result, resutl_msg
190+
180191
def handle(self, test_spec, target_name, toolchain_name):
181192
"""
182193
Function determines MUT's mbed disk/port and copies binary to

0 commit comments

Comments
 (0)