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')
def get_first_arxiv(record): return clean_arxiv(get_value(record, 'arxiv_eprints.value[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'
def test_extract_arxiv_none(): """Test for None param.""" assert clean_arxiv(None) is None
def test_extract_arxiv_id_complex(): """Test getting clean arXiv identifier.""" assert clean_arxiv('arXiv:hep-th/0401244') == 'hep-th/0401244'
def test_extract_arxiv_id_prefix(): """Test getting clean arXiv identifier.""" assert clean_arxiv('arxiv:12356.78') == '12356.78'