Esempio n. 1
0
    def test_get_documents_must_prefers_tif_files_instead_jpeg(self):
        assets, _ = get_document_assets_path(self.xml_etree,
                                             self.package_files,
                                             self.package_path)

        self.assertIn("0034-8910-rsp-47-02-0231-gf01.tif",
                      assets["0034-8910-rsp-47-02-0231-gf01"])
Esempio n. 2
0
    def test_get_documents_assets_must_contain_additional_files_when_references_is_not_complete(
            self):
        _, additionals = get_document_assets_path(self.second_xml_etree,
                                                  self.second_package_files,
                                                  self.second_package_path)

        self.assertIn(
            "0034-8910-rsp-47-02-0403-gf01.jpg",
            additionals["0034-8910-rsp-47-02-0403-gf01"],
        )
Esempio n. 3
0
    def test_get_documents_assets_must_contain_additional_files_with_no_prefered_files(
            self):
        _, additionals = get_document_assets_path(self.xml_etree,
                                                  self.package_files,
                                                  self.package_path)

        self.assertIn(
            "0034-8910-rsp-47-02-0231-gf01.jpg",
            additionals["0034-8910-rsp-47-02-0231-gf01"],
        )
Esempio n. 4
0
    def test_get_documents_assets_should_return_assets_and_additionals(self):
        assets, additionals = get_document_assets_path(self.xml_etree,
                                                       self.package_files,
                                                       self.package_path)

        self.assertEqual(
            [
                "0034-8910-rsp-47-02-0231-gf01",
                "0034-8910-rsp-47-02-0231-gf01-en"
            ],
            list(assets.keys()),
        )

        for additional in additionals.values():
            with self.subTest(additional=additional):
                self.assertNotIn(".tif", additional)
Esempio n. 5
0
    def test_get_documents_assets_should_not_return_assets_path(self):
        assets, additionals = get_document_assets_path(self.xml_etree, [],
                                                       self.package_path)

        self.assertEqual({}, additionals)
        self.assertEqual([None, None], list(assets.values()))