|
17 | 17 |
|
18 | 18 | class DescribeFooterPart(object): |
19 | 19 |
|
| 20 | + def it_is_used_by_loader_to_construct_footer_part( |
| 21 | + self, package_, FooterPart_load_, footer_part_ |
| 22 | + ): |
| 23 | + partname = "footer1.xml" |
| 24 | + content_type = CT.WML_FOOTER |
| 25 | + reltype = RT.FOOTER |
| 26 | + blob = "<w:ftr/>" |
| 27 | + FooterPart_load_.return_value = footer_part_ |
| 28 | + |
| 29 | + part = PartFactory(partname, content_type, reltype, blob, package_) |
| 30 | + |
| 31 | + FooterPart_load_.assert_called_once_with(partname, content_type, blob, package_) |
| 32 | + assert part is footer_part_ |
| 33 | + |
20 | 34 | def it_can_create_a_new_footer_part( |
21 | 35 | self, package_, _default_footer_xml_, parse_xml_, _init_ |
22 | 36 | ): |
@@ -49,6 +63,14 @@ def it_loads_default_footer_XML_from_a_template_to_help(self): |
49 | 63 | def _default_footer_xml_(self, request): |
50 | 64 | return method_mock(request, FooterPart, "_default_footer_xml", autospec=False) |
51 | 65 |
|
| 66 | + @pytest.fixture |
| 67 | + def footer_part_(self, request): |
| 68 | + return instance_mock(request, FooterPart) |
| 69 | + |
| 70 | + @pytest.fixture |
| 71 | + def FooterPart_load_(self, request): |
| 72 | + return method_mock(request, FooterPart, "load", autospec=False) |
| 73 | + |
52 | 74 | @pytest.fixture |
53 | 75 | def _init_(self, request): |
54 | 76 | return initializer_mock(request, FooterPart) |
|
0 commit comments