Пример #1
0
    def test_no_files_in_directory(self):
        if os.path.exists('./tests/data/dcs_world/dynamic_folder_creation'):
            shutil.rmtree('./tests/data/dcs_world/dynamic_folder_creation')

        os.mkdir('./tests/data/dcs_world/dynamic_folder_creation')
        os.mkdir('./tests/data/dcs_world/dynamic_folder_creation/Config')
        os.mkdir('./tests/data/dcs_world/dynamic_folder_creation/Config/Input')

        with self.assertRaises(Exception) as context:
            dcs.DCSWorldParser(
                './tests/data/dcs_world/dynamic_folder_creation')
        self.assertTrue('DCS: No profiles exist in Input directory!' in str(
            context.exception))
Пример #2
0
 def load_dcs_directory(self):
     try:
         self.dcs_profiles_list.clear()
         self.dcs_parser_instance = dcs.DCSWorldParser(
             self.dcs_directory,
             remove_easy_modes=self.dcs_easy_mode_checkbox.isChecked())
         self.print_to_info('Successfully loaded DCS profiles')
         self.enable_profile_load_button(self.dcs_directory_select_button)
         self.dcs_selected_directory_label.setText('in {}'.format(
             self.dcs_directory))
         self.export_button.setEnabled(1)
     except Exception:
         self.disable_profile_load_button(self.dcs_directory_select_button)
         self.export_button.setEnabled(0)
         self.dcs_selected_directory_label.setText('')
         raise
     else:
         self.dcs_profiles_list.clear()
         self.dcs_profiles_list.addItems(
             self.dcs_parser_instance.get_validated_profiles())
Пример #3
0
 def setUp(self):
     self.dcs_instance = dcs.DCSWorldParser(
         './tests/data/dcs_world/valid_dcs_world_directory')
Пример #4
0
 def test_no_joystick_directory(self):
     with self.assertRaises(Exception) as context:
         dcs.DCSWorldParser(
             './tests/data/dcs_world/invalid_dcs_world_no_input')
     self.assertTrue(
         'DCS: No input directory found' in str(context.exception))
Пример #5
0
 def test_no_config_path(self):
     with self.assertRaises(Exception) as context:
         dcs.DCSWorldParser(
             './tests/data/dcs_world/invalid_dcs_world_no_config')
     self.assertTrue('DCS: No Config Folder found in DCS Folder' in str(
         context.exception))