def setUp(self):
<EOL>A, B, C, D = self.define_types()<EOL>self.A, self.B, self.C, self.D,  = A, B, C, D<EOL>self.all_types = {A, B, C, D, AnyObject}<EOL>all_a_exts, all_b_exts, all_c_exts, all_d_exts, all_extensions = self.define_file_extensions()<EOL>self.all_extensions = all_extensions<EOL>self.all_parsers_for_a = set()<EOL>self.all_parsers_for_b = set()<EOL>self.all_parsers_for_c = set()<EOL>self.all_parsers_for_d = set()<EOL>self.all_parsers_generic = set()<EOL>def parse_a():<EOL><INDENT>pass<EOL><DEDENT>def parse_b():<EOL><INDENT>pass<EOL><DEDENT>def parse_c():<EOL><INDENT>pass<EOL><DEDENT>def parse_d():<EOL><INDENT>pass<EOL><DEDENT>a_parser_single = SingleFileParserFunction(parse_a, supported_types={A},<EOL>supported_exts=set(all_a_exts))<EOL>b_parser_single = SingleFileParserFunction(parse_b, supported_types={B}, supported_exts=set(all_b_exts))<EOL>c_parser_single = SingleFileParserFunction(parse_c, supported_types={C}, supported_exts=set(all_c_exts))<EOL>d_parser_single = SingleFileParserFunction(parse_d, supported_types={D}, supported_exts=set(all_d_exts))<EOL>parsers_specific_singlefile_onetype = [a_parser_single, b_parser_single, c_parser_single, d_parser_single]<EOL>self.all_parsers_for_a.add(a_parser_single)<EOL>self.all_parsers_for_b.add(b_parser_single)<EOL>self.all_parsers_for_c.add(c_parser_single)<EOL>self.all_parsers_for_d.add(d_parser_single)<EOL>def parse_a_or_d():<EOL><INDENT>pass<EOL><DEDENT>def parse_b_or_c():<EOL><INDENT>pass<EOL><DEDENT>ad_parser_single = SingleFileParserFunction(parse_a_or_d, supported_types={A, D},<EOL>supported_exts=set(all_a_exts).union(all_d_exts))<EOL>bc_parser_single = SingleFileParserFunction(parse_b_or_c, supported_types={B, C},<EOL>supported_exts=set(all_b_exts).union(all_c_exts))<EOL>parsers_specific_singlefile_severaltypes = [ad_parser_single, bc_parser_single]<EOL>self.all_parsers_for_a.add(ad_parser_single)<EOL>self.all_parsers_for_b.add(bc_parser_single)<EOL>self.all_parsers_for_c.add(bc_parser_single)<EOL>self.all_parsers_for_d.add(ad_parser_single)<EOL>class DummyMultifileParser(MultiFileParser):<EOL><INDENT>def __init__(self, supported_types):<EOL><INDENT>super(DummyMultifileParser, self).__init__(supported_types)<EOL><DEDENT>def __str__(self):<EOL><INDENT>return '<STR_LIT>' + str([get_pretty_type_str(typ) for typ in self.supported_types])+ '<STR_LIT>' + str(self.supported_exts)<EOL><DEDENT>def _get_parsing_plan_for_multifile_children(self, obj_on_fs: PersistedObject, desired_type: Type[T],<EOL>logger: Logger) -> Dict[str, _BaseParsingPlan[Any]]:<EOL><INDENT>pass<EOL><DEDENT>def _parse_multifile(self, desired_type: Type[T], obj: PersistedObject,<EOL>parsing_plan_for_children: Dict[str, AnyParser._RecursiveParsingPlan], logger: Logger,<EOL>options: Dict[str, Dict[str, Any]]) -> T:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>a_parser_multi = DummyMultifileParser(supported_types={A})<EOL>b_parser_multi = DummyMultifileParser(supported_types={B})<EOL>c_parser_multi = DummyMultifileParser(supported_types={C})<EOL>d_parser_multi = DummyMultifileParser(supported_types={D})<EOL>parsers_specific_multifile_onetype = [a_parser_multi, b_parser_multi, c_parser_multi, d_parser_multi]<EOL>self.all_parsers_for_a.add(a_parser_multi)<EOL>self.all_parsers_for_b.add(b_parser_multi)<EOL>self.all_parsers_for_c.add(c_parser_multi)<EOL>self.all_parsers_for_d.add(d_parser_multi)<EOL>bd_parser_multi = DummyMultifileParser(supported_types={B, D})<EOL>ac_parser_multi = DummyMultifileParser(supported_types={A, C})<EOL>parsers_specific_multifile_severaltypes = [bd_parser_multi, ac_parser_multi]<EOL>self.all_parsers_for_a.add(ac_parser_multi)<EOL>self.all_parsers_for_b.add(bd_parser_multi)<EOL>self.all_parsers_for_c.add(ac_parser_multi)<EOL>self.all_parsers_for_d.add(bd_parser_multi)<EOL>class DummyParser(AnyParser):<EOL><INDENT>def __init__(self, supported_types, supported_exts):<EOL><INDENT>super(DummyParser, self).__init__(supported_types=supported_types,<EOL>supported_exts=supported_exts)<EOL><DEDENT>def _get_parsing_plan_for_multifile_children(self, obj_on_fs: PersistedObject, desired_type: Type[T],<EOL>logger: Logger) -> Dict[str, _BaseParsingPlan[Any]]:<EOL><INDENT>pass<EOL><DEDENT>def _parse_multifile(self, desired_type: Type[T], obj: PersistedObject,<EOL>parsing_plan_for_children: Dict[str, AnyParser._RecursiveParsingPlan], logger: Logger,<EOL>options: Dict[str, Dict[str, Any]]) -> T:<EOL><INDENT>pass<EOL><DEDENT>def _parse_singlefile(self, desired_type: Type[T], file_path: str, encoding: str, logger: Logger,<EOL>options: Dict[str, Dict[str, Any]]) -> T:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>a_parser_both = DummyParser(supported_types={A}, supported_exts=set(all_a_exts))<EOL>b_parser_both = DummyParser(supported_types={B}, supported_exts=set(all_b_exts))<EOL>c_parser_both = DummyParser(supported_types={C}, supported_exts=set(all_c_exts))<EOL>d_parser_both = DummyParser(supported_types={D}, supported_exts=set(all_d_exts))<EOL>parsers_specific_bothfile_onetype = [a_parser_both, b_parser_both, c_parser_both, d_parser_both]<EOL>self.all_parsers_for_a.add(a_parser_both)<EOL>self.all_parsers_for_b.add(b_parser_both)<EOL>self.all_parsers_for_c.add(c_parser_both)<EOL>self.all_parsers_for_d.add(d_parser_both)<EOL>abc_parser_both = DummyParser(supported_types={A, B, C},<EOL>supported_exts=set(all_a_exts).union(all_b_exts).union(<EOL>all_c_exts))<EOL>acd_parser_both = DummyParser(supported_types={A, C, D},<EOL>supported_exts=set(all_a_exts).union(all_c_exts).union(<EOL>all_d_exts))<EOL>parsers_specific_bothfile_severaltypes = [abc_parser_both, acd_parser_both]<EOL>self.all_parsers_for_a = self.all_parsers_for_a.union({abc_parser_both, acd_parser_both})<EOL>self.all_parsers_for_b.add(abc_parser_both)<EOL>self.all_parsers_for_c = self.all_parsers_for_c.union({abc_parser_both, acd_parser_both})<EOL>self.all_parsers_for_d.add(acd_parser_both)<EOL>def parse_any():<EOL><INDENT>pass<EOL><DEDENT>any_parser_singlefile = SingleFileParserFunction(parse_any, supported_types={AnyObject},<EOL>supported_exts=set(all_d_exts))<EOL>parsers_generic_singlefile = [any_parser_singlefile]<EOL>any_parser_multifile = DummyMultifileParser(supported_types={AnyObject})<EOL>parsers_generic_multifile = [any_parser_multifile]<EOL>any_parser_bothfile = DummyParser(supported_types={AnyObject}, supported_exts=set(all_a_exts))<EOL>parsers_generic_bothfile = [any_parser_bothfile]<EOL>self.all_parsers_generic = self.all_parsers_generic.union(set(parsers_generic_singlefile)).union(set(parsers_generic_multifile)).union(set(parsers_generic_bothfile))<EOL>self.all_parsers_lists = [parsers_specific_singlefile_onetype,<EOL>parsers_specific_singlefile_severaltypes,<EOL>parsers_specific_multifile_onetype,<EOL>parsers_specific_multifile_severaltypes,<EOL>parsers_specific_bothfile_onetype,<EOL>parsers_specific_bothfile_severaltypes,<EOL>parsers_generic_singlefile,<EOL>parsers_generic_multifile,<EOL>parsers_generic_bothfile]<EOL>self.all_parsers = {A: self.all_parsers_for_a,<EOL>B: self.all_parsers_for_b,<EOL>C: self.all_parsers_for_c,<EOL>D: self.all_parsers_for_d,<EOL>AnyObject: self.all_parsers_generic}<EOL>
This setup function defines
* the classes that will be used in the whole test class.
* file extensions associated to one or several classes
* parsers

:return: