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): ...@@ -124,8 +124,12 @@ class ServerCompilerSettings(object):
print('\nCompiler file in OS X located within the app bundle.') print('\nCompiler file in OS X located within the app bundle.')
else: else:
print('Could not locate the Arduino executable within the OS X ' print('Could not locate the Arduino executable within the OS X '
'app bundle. These are the available files:\n%s' % 'app bundle. These are the available files:')
os.listdir('%s/Contents/MacOS/' % new_compiler_dir)) try:
print('%s' % os.listdir(
'%s/Contents/MacOS/' % new_compiler_dir))
except OSError as e:
print(e)
# Check directory # Check directory
if os.path.isfile(new_compiler_dir): if os.path.isfile(new_compiler_dir):
......
...@@ -57,8 +57,7 @@ class ServerCompilerSettingsTestCase(unittest.TestCase): ...@@ -57,8 +57,7 @@ class ServerCompilerSettingsTestCase(unittest.TestCase):
Just a folder Just a folder
A non executable file A non executable file
""" """
# TODO: a file that 'exists but does not execute' is not done # Test for failure, mock that the files does not exists
# Random file
mock_os_path_isfile.return_value = False mock_os_path_isfile.return_value = False
original_dir = ServerCompilerSettings().compiler_dir original_dir = ServerCompilerSettings().compiler_dir
new_dir = os.path.join(os.getcwd(), 'random.exe') 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