コード例 #1
0
 def test_browse_file_cancel(self):
     canceled_file = ''
     print('A file browser window will open, to successfully run this test '
           'press cancel or close the window!!!\n')
     #raw_input('Press "Enter" to continue...')
     function_file = gui.browse_file_dialog()
     self.assertEqual(canceled_file, function_file)
コード例 #2
0
ファイル: gui_test.py プロジェクト: CartonBuilder/ardublockly
 def test_browse_file_cancel(self):
     canceled_file = ''
     print('A file browser window will open, to successfully run this test '
           'press cancel or close the window!!!\n')
     #raw_input('Press "Enter" to continue...')
     function_file = gui.browse_file_dialog()
     self.assertEqual(canceled_file, function_file)
コード例 #3
0
def set_compiler_path():
    """
    Opens the file browser to select a file. Saves this file path into
    ServerCompilerSettings and if the file path is different to that stored
    already it triggers the new data to be saved into the settings file.
    """
    new_path = gui.browse_file_dialog()
    if new_path != '':
        ServerCompilerSettings().compiler_dir = new_path
    return get_compiler_path()
コード例 #4
0
ファイル: actions.py プロジェクト: CocoMake7/CocoBlockly
def set_compiler_path():
    """
    Opens the file browser to select a file. Saves this file path into
    ServerCompilerSettings and if the file path is different to that stored
    already it triggers the new data to be saved into the settings file.
    """
    new_path = gui.browse_file_dialog()
    if new_path != '':
        ServerCompilerSettings().compiler_dir = new_path
    return get_compiler_path()
コード例 #5
0
 def test_browse_file(self, mock_file_select):
     test_file = os.path.join(os.getcwd(), 'test_file')
     mock_file_select.return_value = test_file
     new_file = gui.browse_file_dialog()
     self.assertEqual(new_file, test_file)
コード例 #6
0
ファイル: gui_test.py プロジェクト: CartonBuilder/ardublockly
 def test_browse_file(self, mock_file_select):
     test_file = os.path.join(os.getcwd(), 'test_file')
     mock_file_select.return_value = test_file
     new_file = gui.browse_file_dialog()
     self.assertEqual(new_file, test_file)