Beispiel #1
0
 def test_normalize_id_with_cache(self):
     identifiers = ['doi:10.1123/ijatt']
     output_data = list()
     csv_manager = CSVManager()
     csv_manager.data = {'10.1123/ijatt.2015-0070': {'v'}}
     for id in identifiers:
         output_data.append(
             Cleaner(id).normalize_id(valid_dois_cache=csv_manager))
     expected_data = [None]
     expected_cache = {
         '10.1123/ijatt.2015-0070': {'v'},
         '10.1123/ijatt': {'i'}
     }
     output = (csv_manager.data, output_data)
     expected_output = (expected_cache, expected_data)
     self.assertEqual(output, expected_output)
 def test_get_agents_strings_list_overlapping_surnames(self):
     # The surname of one author is included in the surname of another.
     authors_list = [
         {
             "given": "Puvaneswari",
             "family": "Paravamsivam",
             "sequence": "first",
             "affiliation": []
         },
         {
             "given": "Chua Kek",
             "family": "Heng",
             "sequence": "additional",
             "affiliation": []
         },
         {
             "given": "Sri Nurestri Abdul",
             "family": "Malek",
             "sequence": "additional",
             "affiliation": []
         },
         {
             "given": "Vikineswary",
             "family": "Sabaratnam",
             "sequence": "additional",
             "affiliation": []
         },
         {
             "given": "Ravishankar Ram",
             "family": "M",
             "sequence": "additional",
             "affiliation": []
         },
         {
             "given": "Umah Rani",
             "family": "Kuppusamy",
             "sequence": "additional",
             "affiliation": []
         }
     ]
     crossref_processor = CrossrefProcessing(None, None)
     csv_manager = CSVManager()
     csv_manager.data = {'10.9799/ksfan.2012.25.1.105': {'Malek, Sri Nurestri Abdul [orcid:0000-0001-6278-8559]'}}
     crossref_processor.orcid_index = csv_manager
     authors_strings_list = crossref_processor.get_agents_strings_list('10.9799/ksfan.2012.25.1.105', authors_list)
     expected_authors_list = ['Paravamsivam, Puvaneswari', 'Heng, Chua Kek', 'Malek, Sri Nurestri Abdul [orcid:0000-0001-6278-8559]', 'Sabaratnam, Vikineswary', 'M, Ravishankar Ram', 'Kuppusamy, Umah Rani']
     self.assertEqual(authors_strings_list, expected_authors_list)