Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_4_digits_suffix_version_new():
ref_line = u"""{any prefix}9910.1234v9 [physics.ins-det]{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:9910.1234 [physics.ins-det]{any postfix}"
def test_4_digits_suffix_version():
ref_line = u"""{any prefix}arXiv:1104.2222v9 [physics.ins-det]{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:1104.2222 [physics.ins-det]{any postfix}"
def test_5_digits_suffix_version_new_2012():
ref_line = u"""{any prefix}1210.12345v9 [physics.ins-det]{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}1210.12345v9 [physics.ins-det]{any postfix}"
def test_4_digits_new():
ref_line = u"""{any prefix}9910.1234{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:9910.1234{any postfix}"
def test_4_digits_version_new_url():
ref_line = u"""{any prefix}https://arxiv.org/abs/0708.0882v1{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:0708.0882{any postfix}"
def test_5_digits_suffix_new():
ref_line = u"""{any prefix}1310.12345 [physics.ins-det]{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:1310.12345 [physics.ins-det]{any postfix}"
def test_4_digits_suffix():
ref_line = u"""{any prefix}arXiv:1104.2222 [physics.ins-det]{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:1104.2222 [physics.ins-det]{any postfix}"
def test_5_digits_new_pdf_url():
ref_line = u"""{any prefix}https://arxiv.org/pdf/1712.03976.pdf{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:1712.03976{any postfix}"
def test_4_digits_version():
ref_line = u"""{any prefix}arXiv:1003.1111v9{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:1003.1111{any postfix}"
def test_4_digits_new_url():
ref_line = u"""{any prefix}https://arxiv.org/abs/1311.2198{any postfix}"""
r = tag_arxiv(ref_line)
assert r.strip(': ') == u"{any prefix}arXiv:1311.2198{any postfix}"