def test_print_configuration_with_no_dsname_and_no_ds_all_returns_explanation(
         self):
     with mock.patch(
             'tdvt.config_gen.datasource_list.TestRegistry.get_datasources',
             side_effect=TypeError):
         captured_output = io.StringIO()
         sys.stdout = captured_output  # redirect stdout to a StringIO obj to catch the print statement.
         datasource_list.print_configurations(
             datasource_list.TestRegistry('test'), None, None)
         self.assertIn(datasource_list.RUN_IN_INCORRECT_DIRECTORY_MSG,
                       captured_output.getvalue())
    def test_load_windows_override(self):
        ini_file = get_path('tool_test/ini', 'windows_override.ini', __name__)
        reg = datasource_list.TestRegistry('')
        reg.load_registry(ini_file)

        #Duplicates should be removed and the order preserved.
        standard = ['teradata', 'netezza']
        all_passing = ['teradata', 'netezza', 'bigquery', 'exasolution']
        all_test = ['hadoophive2_hortonworks', 'teradata', 'netezza', 'bigquery', 'exasolution']
        all_test2 = ['hadoophive2_hortonworks', 'teradata', 'netezza', 'bigquery', 'exasolution']

        self.assertTrue(standard == reg.get_datasources('standard'))
        self.assertTrue(all_passing == reg.get_datasources('all_passing'))
        self.assertTrue(all_test == reg.get_datasources('all_test'))
        self.assertTrue(all_test2 == reg.get_datasources('all_test2'))