def test_compute_author_match_one_empty_list(): x_authors = [] y_authors = [ { 'full_name': 'Kobayashi, Makoto' }, { 'full_name': 'Maskawa, Toshihide' }, ] result = compute_author_match_score(x_authors, y_authors) assert result == 0.0
def test_compute_author_match_score_different_authors(): x_authors = [{ 'full_name': 'Cabibbo, Nicola' }, { 'full_name': 'Kobayashi, Makoto' }, { 'full_name': 'Maskawa, Toshihide' }, { 'full_name': 'Smith, John' }] y_authors = [ { 'full_name': 'Sinatra, Mary' }, { 'full_name': 'Blueds, Michael' }, ] result = compute_author_match_score(x_authors, y_authors) assert result == 0.0
def test_compute_author_match_score_similar_authors(): x_authors = [{ 'full_name': 'Cabibbo, Nicola' }, { 'full_name': 'Kobayashi, Makoto' }, { 'full_name': 'Maskawa, Toshihide' }, { 'full_name': 'Smith, John' }] y_authors = [ { 'full_name': 'Kobayashi, Makoto' }, { 'full_name': 'Maskawa, Toshihide' }, ] result = compute_author_match_score(x_authors, y_authors) assert result == 0.5