Added file remove function with exception handling

pull/399/head
Przemek Wirkus 2014-07-10 11:24:02 +01:00
parent 1dbeae4423
commit c159494e35
1 changed files with 11 additions and 0 deletions

View File

@ -177,6 +177,17 @@ class SingleTestRunner(object):
# Default python method
copy(image_path, disk)
def delete_file(file_path):
""" Remove file from the system """
result = True
resutl_msg = ""
try:
os.remove(file_path)
except Exception, e:
resutl_msg = e
result = False
return result, resutl_msg
def handle(self, test_spec, target_name, toolchain_name):
"""
Function determines MUT's mbed disk/port and copies binary to