Exemplo n.º 1
0
 def it_constructs_part_using_default_class_when_no_custom_registered(
         self, part_args_2_, DefaultPartClass_, part_of_default_type_):
     partname, content_type, pkg, blob = part_args_2_
     part = PartFactory(partname, content_type, pkg, blob)
     DefaultPartClass_.load.assert_called_once_with(partname, content_type,
                                                    pkg, blob)
     assert part is part_of_default_type_
 def it_constructs_custom_part_type_for_registered_content_types(
     self, part_args_, CustomPartClass_, part_of_custom_type_
 ):
     # fixture ----------------------
     partname, content_type, pkg, blob = part_args_
     # exercise ---------------------
     PartFactory.part_type_for[content_type] = CustomPartClass_
     part = PartFactory(partname, content_type, pkg, blob)
     # verify -----------------------
     CustomPartClass_.load.assert_called_once_with(partname, content_type, pkg, blob)
     assert part is part_of_custom_type_