Пример #1
0
    def test_highwire_pdf_values_produce_highwire_pdf_document_uris(self):
        highwire_dict = {
            "pdf_url": [
                "http://example.com/1.pdf",
                "http://example.com/2.pdf",
                "http://example.com/3.pdf",
            ]
        }

        document_uris = document_claims.document_uris_from_highwire_pdf(
            highwire_dict, claimant="http://example.com/example.html")

        for pdf in highwire_dict["pdf_url"]:
            document_uri = one(
                [d for d in document_uris if d.get("uri") == pdf])
            assert document_uri == {
                "claimant": "http://example.com/example.html",
                "uri": pdf,
                "type": "highwire-pdf",
                "content_type": "application/pdf",
            }
Пример #2
0
    def test_highwire_pdf_values_produce_highwire_pdf_document_uris(self):
        highwire_dict = {
                'pdf_url': ['http://example.com/1.pdf',
                            'http://example.com/2.pdf',
                            'http://example.com/3.pdf'],
        }

        document_uris = document_claims.document_uris_from_highwire_pdf(
            highwire_dict,
            claimant='http://example.com/example.html',
        )

        for pdf in highwire_dict['pdf_url']:
            document_uri = one([d for d in document_uris
                                if d.get('uri') == pdf])
            assert document_uri == {
                'claimant': 'http://example.com/example.html',
                'uri': pdf,
                'type': 'highwire-pdf',
                'content_type': 'application/pdf',
            }