def test_link_to_hep_affiliation_returns_empty_string_when_record_has_no_ICN(): without_ICN = {} expected = '' result = link_to_hep_affiliation(without_ICN) assert expected == result
def test_link_to_hep_affiliation_returns_empty_string_when_record_has_no_ICN(): without_ICN = {} expected = '' result = link_to_hep_affiliation(without_ICN) assert expected == result
def test_link_to_hep_affiliation_plural_when_more_results(s, mock_perform_es_search_tworecord): s.return_value = mock_perform_es_search_tworecord with_ICN = {'ICN': 'Fermilab'} expected = '2 Papers from Fermilab' result = link_to_hep_affiliation(with_ICN) assert expected == result
def test_link_to_hep_affiliation_singular_when_one_result(s, mock_perform_es_search_onerecord): s.return_value = mock_perform_es_search_onerecord with_ICN = {'ICN': 'DESY'} expected = '1 Paper from DESY' result = link_to_hep_affiliation(with_ICN) assert expected == result
def test_link_to_hep_affiliation_returns_empty_string_when_empty_results(s, mock_perform_es_search_empty): s.return_value = mock_perform_es_search_empty with_ICN = {'ICN': 'CERN'} expected = '' result = link_to_hep_affiliation(with_ICN) assert expected == result
def test_link_to_hep_affiliation_plural_when_more_results( s, mock_perform_es_search_tworecord): s.return_value = mock_perform_es_search_tworecord with_ICN = {'ICN': 'Fermilab'} expected = '2 Papers from Fermilab' result = link_to_hep_affiliation(with_ICN) assert expected == result
def test_link_to_hep_affiliation_singular_when_one_result( s, mock_perform_es_search_onerecord): s.return_value = mock_perform_es_search_onerecord with_ICN = {'ICN': 'DESY'} expected = '1 Paper from DESY' result = link_to_hep_affiliation(with_ICN) assert expected == result
def test_link_to_hep_affiliation_returns_empty_string_when_empty_results( s, mock_perform_es_search_empty): s.return_value = mock_perform_es_search_empty with_ICN = {'ICN': 'CERN'} expected = '' result = link_to_hep_affiliation(with_ICN) assert expected == result