Exemplo n.º 1
0
    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'])
Exemplo n.º 2
0
    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')
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
    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']))
Exemplo n.º 5
0
    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)