def test_cleaner(self): rawParams = {"input_file": "etc/example.tsv", "output_file": "output.tmp", "config_file": "etc/config.yaml"} params = objects.Configuration(param_fields, rawParams) config = generate_config_yaml(conf_fields, params.config_file) if isfile(params.output_file): remove(params.output_file) cleaner(params, config) self.assertTrue(isfile(params.output_file)) self.assertEqual(wordCount(" to ", params.output_file), 0) self.assertEqual(wordCount(" photo ", params.output_file), 0)
def run_cleaner(): """ Runnable function """ setup_logging() description = 'Text cleaner' epilog = 'Pablo Torres, [email protected]' params = generate_parameter(param_fields, description, epilog) config = generate_config_yaml(conf_fields, params.config_file) cleaner(params, config) sys.exit(0)