示例#1
0
def test_parse_search_first_author(mock_init_sample):
    matches = u.parse_search('author:"^Virtanen"')
    assert len(matches) == 1
    assert matches[0].key == 'VirtanenEtal2020natmeScipy'
示例#2
0
def test_parse_search_multiple_authors(mock_init_sample):
    matches = u.parse_search('author:"oliphant" author:"jones, e"')
    assert len(matches) == 1
    assert matches[0].key == 'VirtanenEtal2020natmeScipy'
示例#3
0
def test_parse_search_author(mock_init_sample, search_text):
    matches = u.parse_search(search_text)
    assert len(matches) == 2
    assert matches[0].key == 'HarrisEtal2020natNumpy'
    assert matches[1].key == 'VirtanenEtal2020natmeScipy'
示例#4
0
def test_parse_search_year_invalid(mock_init_sample):
    matches = u.parse_search('year:1913a')
    assert matches == []
示例#5
0
def test_parse_search_year_open(mock_init_sample):
    matches = u.parse_search('year:2020-')
    print(matches[1].key)
    assert len(matches) == 2
    assert matches[0].key == 'HarrisEtal2020natNumpy'
    assert matches[1].key == 'VirtanenEtal2020natmeScipy'
示例#6
0
def test_parse_search_year_fixed(mock_init_sample, search_text):
    matches = u.parse_search(search_text)
    assert len(matches) == 1
    assert matches[0].key == 'Slipher1913lobAndromedaRarialVelocity'
示例#7
0
def test_parse_search_null(mock_init_sample):
    matches = u.parse_search('')
    assert matches == []