def test_identifier_filter_special_arXiv(self):
     """oaiharvest - testing identifier filter for arXiv."""
     from invenio_oaiharvester.utils import get_identifier_names
     self.assertEqual(get_identifier_names("oai:arxiv.org:1234.1245"),
                      ["oai:arXiv.org:1234.1245"])
     self.assertEqual(get_identifier_names("oai:arXiv.org:1234.1245, arXiv:1234.1245"),
                      ["oai:arXiv.org:1234.1245", "oai:arXiv.org:1234.1245"])
     self.assertEqual(get_identifier_names("oai:arXiv.org:1234.12452"),
                      ["oai:arXiv.org:1234.12452"])
 def test_identifier_filter(self):
     """oaiharvest - testing identifier filter."""
     from invenio_oaiharvester.utils import get_identifier_names
     self.assertEqual(get_identifier_names("oai:mysite.com:1234"),
                      ["oai:mysite.com:1234"])
     self.assertEqual(get_identifier_names("oai:mysite.com:1234, oai:example.com:2134"),
                      ["oai:mysite.com:1234", "oai:example.com:2134"])
     self.assertEqual(get_identifier_names("oai:mysite.com:1234/testing, oai:example.com:record/1234"),
                      ["oai:mysite.com:1234/testing", "oai:example.com:record/1234"])
 def test_identifier_filter_special_arXiv(self):
     """oaiharvest - testing identifier filter for arXiv."""
     from invenio_oaiharvester.utils import get_identifier_names
     self.assertEqual(get_identifier_names("oai:arxiv.org:1234.1245"),
                      ["oai:arXiv.org:1234.1245"])
     self.assertEqual(
         get_identifier_names("oai:arXiv.org:1234.1245, arXiv:1234.1245"),
         ["oai:arXiv.org:1234.1245", "oai:arXiv.org:1234.1245"])
     self.assertEqual(get_identifier_names("oai:arXiv.org:1234.12452"),
                      ["oai:arXiv.org:1234.12452"])
 def test_identifier_filter(self):
     """oaiharvest - testing identifier filter."""
     from invenio_oaiharvester.utils import get_identifier_names
     self.assertEqual(get_identifier_names("oai:mysite.com:1234"),
                      ["oai:mysite.com:1234"])
     self.assertEqual(
         get_identifier_names("oai:mysite.com:1234, oai:example.com:2134"),
         ["oai:mysite.com:1234", "oai:example.com:2134"])
     self.assertEqual(
         get_identifier_names(
             "oai:mysite.com:1234/testing, oai:example.com:record/1234"),
         ["oai:mysite.com:1234/testing", "oai:example.com:record/1234"])
Exemple #5
0
def test_identifier_filter():
    """oaiharvest - testing identifier filter."""
    sample = "oai:mysite.com:1234"
    assert get_identifier_names(sample) == ["oai:mysite.com:1234"]

    sample = "oai:mysite.com:1234, oai:example.com:2134"
    expected = ["oai:mysite.com:1234", "oai:example.com:2134"]
    assert get_identifier_names(sample) == expected

    sample = "oai:mysite.com:1234/testing, oai:example.com:record/1234"
    expected = ["oai:mysite.com:1234/testing", "oai:example.com:record/1234"]
    assert get_identifier_names(sample) == expected

    assert get_identifier_names([]) == []
    assert get_identifier_names(None) == []
def test_identifier_filter():
    """oaiharvest - testing identifier filter."""
    sample = "oai:mysite.com:1234"
    assert get_identifier_names(sample) == ["oai:mysite.com:1234"]

    sample = "oai:mysite.com:1234, oai:example.com:2134"
    expected = ["oai:mysite.com:1234", "oai:example.com:2134"]
    assert get_identifier_names(sample) == expected

    sample = "oai:mysite.com:1234/testing, oai:example.com:record/1234"
    expected = ["oai:mysite.com:1234/testing", "oai:example.com:record/1234"]
    assert get_identifier_names(sample) == expected

    assert get_identifier_names([]) == []
    assert get_identifier_names(None) == []