Ejemplo n.º 1
0
    def test_get_all_by_uri(self):
        # add two documents and make sure we can search for both

        d = Document({
            "id": "1",
            "title": "document1",
            "link": [
                {
                    "href": "https://peerj.com/articles/53/",
                    "type": "text/html"
                },
            ]
        })
        d.save()

        d = Document({
            "id": "2",
            "title": "document2",
            "link": [
                {
                    "href": "https://peerj.com/articles/53.pdf",
                    "type": "application/pdf"
                }
            ]
        })
        d.save()

        docs = Document.get_all_by_uris(["https://peerj.com/articles/53/", "https://peerj.com/articles/53.pdf"])
        assert_equal(len(docs), 2)
Ejemplo n.º 2
0
    def test_get_all_by_uri(self):
        # add two documents and make sure we can search for both

        d = Document({
            "id":
            "1",
            "title":
            "document1",
            "link": [
                {
                    "href": "https://peerj.com/articles/53/",
                    "type": "text/html"
                },
            ]
        })
        d.save()

        d = Document({
            "id":
            "2",
            "title":
            "document2",
            "link": [{
                "href": "https://peerj.com/articles/53.pdf",
                "type": "application/pdf"
            }]
        })
        d.save()

        docs = Document.get_all_by_uris([
            "https://peerj.com/articles/53/",
            "https://peerj.com/articles/53.pdf"
        ])
        assert_equal(len(docs), 2)