def test_change_output_fmt(self): desc_dict = {blockNames.ConfigParams.output_fmt: 'csv'} configuration = config.Config() self.assertNotEqual(configuration.output_format, ['csv']) configuration.load_config(desc_dict) self.assertEqual(configuration.output_format, ['csv'])
def test_change_input_dir(self): desc_dict = {blockNames.ConfigParams.input_dir: 'alternative'} configuration = config.Config() self.assertNotEqual(configuration.input_dir, 'alternative') configuration.load_config(desc_dict) self.assertEqual(configuration.input_dir, 'alternative')
def test_change_df_struct_name(self): desc_dict = {blockNames.ConfigParams.df_struct_name: 'alternative'} configuration = config.Config() self.assertNotEqual(configuration._df_struct_name, 'alternative') configuration.load_config(desc_dict) self.assertEqual(configuration._df_struct_name, 'alternative')
def test_change_output_fmt_list(self): desc_dict = {blockNames.ConfigParams.output_fmt: ['pickle', 'csv']} configuration = config.Config() #order is reversed in default values self.assertNotEqual(configuration.output_format, ['pickle', 'csv']) configuration.load_config(desc_dict) self.assertEqual(set(configuration.output_format), set(['pickle', 'csv']))
def test_change_raw_output_dir(self): desc_dict = {blockNames.ConfigParams.raw_output_dir: 'alternative'} configuration = config.Config() golden_val = os.path.join('data', 'alternative') self.assertNotEqual(configuration._raw_output_dir, golden_val) configuration.load_config(desc_dict) self.assertEqual(configuration._raw_output_dir, golden_val)