Exemple #1
0
def test_extract_arxiv_additional_chars():
    """
    Test getting clean arXiv identifier with additional chars.
    Delivered for article: 10.1140/epjc/s10052-018-6500-y
    """
    with raises(UnicodeEncodeError):
        clean_arxiv(u'"1808.01899\u201c')
Exemple #2
0
def test_extract_arxiv_additional_chars():
    """
    Test getting clean arXiv identifier with additional chars.
    Delivered for article: 10.1140/epjc/s10052-018-6500-y
    """
    with raises(UnicodeEncodeError):
        clean_arxiv(u'"1808.01899\u201c')
Exemple #3
0
def get_first_arxiv(record):
    return clean_arxiv(get_value(record, 'arxiv_eprints.value[0]'))
Exemple #4
0
def test_extract_arxiv_with_categ():
    """
    Test for arxiv with category.
    Delivered for article: 10.1140/epjc/s10052-019-6679-6
    """
    assert clean_arxiv('arXiv:1803.07217 [gr-qc]') == '1803.07217'
Exemple #5
0
def test_extract_arxiv_none():
    """Test for None param."""
    assert clean_arxiv(None) is None
Exemple #6
0
def test_extract_arxiv_id_complex():
    """Test getting clean arXiv identifier."""
    assert clean_arxiv('arXiv:hep-th/0401244') == 'hep-th/0401244'
Exemple #7
0
def test_extract_arxiv_id_prefix():
    """Test getting clean arXiv identifier."""
    assert clean_arxiv('arxiv:12356.78') == '12356.78'
Exemple #8
0
def test_extract_arxiv_with_categ():
    """
    Test for arxiv with category.
    Delivered for article: 10.1140/epjc/s10052-019-6679-6
    """
    assert clean_arxiv('arXiv:1803.07217 [gr-qc]') == '1803.07217'
Exemple #9
0
def test_extract_arxiv_none():
    """Test for None param."""
    assert clean_arxiv(None) is None
Exemple #10
0
def test_extract_arxiv_id_complex():
    """Test getting clean arXiv identifier."""
    assert clean_arxiv('arXiv:hep-th/0401244') == 'hep-th/0401244'
Exemple #11
0
def test_extract_arxiv_id_prefix():
    """Test getting clean arXiv identifier."""
    assert clean_arxiv('arxiv:12356.78') == '12356.78'
Exemple #12
0
def get_first_arxiv(record):
    return clean_arxiv(get_value(record, 'arxiv_eprints.value[0]'))