Пример #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')
Пример #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')
Пример #3
0
def get_first_arxiv(record):
    return clean_arxiv(get_value(record, 'arxiv_eprints.value[0]'))
Пример #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'
Пример #5
0
def test_extract_arxiv_none():
    """Test for None param."""
    assert clean_arxiv(None) is None
Пример #6
0
def test_extract_arxiv_id_complex():
    """Test getting clean arXiv identifier."""
    assert clean_arxiv('arXiv:hep-th/0401244') == 'hep-th/0401244'
Пример #7
0
def test_extract_arxiv_id_prefix():
    """Test getting clean arXiv identifier."""
    assert clean_arxiv('arxiv:12356.78') == '12356.78'
Пример #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'
Пример #9
0
def test_extract_arxiv_none():
    """Test for None param."""
    assert clean_arxiv(None) is None
Пример #10
0
def test_extract_arxiv_id_complex():
    """Test getting clean arXiv identifier."""
    assert clean_arxiv('arXiv:hep-th/0401244') == 'hep-th/0401244'
Пример #11
0
def test_extract_arxiv_id_prefix():
    """Test getting clean arXiv identifier."""
    assert clean_arxiv('arxiv:12356.78') == '12356.78'
Пример #12
0
def get_first_arxiv(record):
    return clean_arxiv(get_value(record, 'arxiv_eprints.value[0]'))