示例#1
0
    def test_adds_qc_page_for_all_subjects_in_list(self):
        html_page = MagicMock()
        subjects = ['subject1', 'subject2', 'subject3']
        html_string = '<a href="{}/qc.html">'

        html.add_image_and_subject_index(html_page, [], subjects, 'test')

        args_list = html_page.write.call_args_list

        for subject in subjects:
            assert self.call_found(html_page.write.call_args_list,
                                   html_string.format(subject))
示例#2
0
    def test_adds_all_expected_images_to_page(self):
        html_page = MagicMock()
        image1 = self.__make_image_stub('temporal')
        image2 = self.__make_image_stub('medial')
        images = [image1, image2]

        html.add_image_and_subject_index(html_page, images, [], 'test')

        image_link = '<a href="{}.html">'
        for image in images:
            assert self.call_found(html_page.write.call_args_list,
                                   image_link.format(image.name))
示例#3
0
    def test_image_not_added_to_index_if_image_settings_exclude_it(self):
        html_page = MagicMock()
        image1 = self.__make_image_stub('temporal')
        image2 = self.__make_image_stub('medial', make=False)
        image3 = self.__make_image_stub('mpfc')
        images = [image1, image2, image3]

        html.add_image_and_subject_index(html_page, images, [], 'test')

        image_link = '<a href="{}.html">'.format(image2.name)
        assert html_page.write.call_count > 1
        for call in html_page.write.call_args_list:
            assert image_link not in call[0]