Commit 581ea806 authored by carlosperate's avatar carlosperate

Fix mac issue when compiler file selected does not exists.

parent 225086cd
......@@ -124,8 +124,12 @@ class ServerCompilerSettings(object):
print('\nCompiler file in OS X located within the app bundle.')
else:
print('Could not locate the Arduino executable within the OS X '
'app bundle. These are the available files:\n%s' %
os.listdir('%s/Contents/MacOS/' % new_compiler_dir))
'app bundle. These are the available files:')
try:
print('%s' % os.listdir(
'%s/Contents/MacOS/' % new_compiler_dir))
except OSError as e:
print(e)
# Check directory
if os.path.isfile(new_compiler_dir):
......
......@@ -57,8 +57,7 @@ class ServerCompilerSettingsTestCase(unittest.TestCase):
Just a folder
A non executable file
"""
# TODO: a file that 'exists but does not execute' is not done
# Random file
# Test for failure, mock that the files does not exists
mock_os_path_isfile.return_value = False
original_dir = ServerCompilerSettings().compiler_dir
new_dir = os.path.join(os.getcwd(), 'random.exe')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment