def test_parse_search_first_author(mock_init_sample): matches = u.parse_search('author:"^Virtanen"') assert len(matches) == 1 assert matches[0].key == 'VirtanenEtal2020natmeScipy'
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'
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'
def test_parse_search_year_invalid(mock_init_sample): matches = u.parse_search('year:1913a') assert matches == []
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'
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'
def test_parse_search_null(mock_init_sample): matches = u.parse_search('') assert matches == []