def test_author_square_brackets(self): test_string = """Jie (Kate) Hu [aut, cre], Norman Breslow [aut], Gary Chan [aut]""" byline = Byline(test_string) response = byline.author_email_pairs() expected = None assert_equals(response, expected)
def save_host_contributors(self): raw_byline_string = self.api_raw["Author"] maintainer = self.api_raw["Maintainer"] byline = Byline(raw_byline_string) extracted_name_dicts = byline.author_email_pairs() for kwargs_dict in extracted_name_dicts: person = get_or_make_person(**kwargs_dict) self._save_contribution(person, "author")
def save_host_contributors(self): raw_byline_string = self.api_raw["info"]["author"] author_email = self.api_raw["info"]["author_email"] byline = Byline(raw_byline_string) extracted_name_dicts = byline.author_email_pairs() # use the author email field only if only one name if len(extracted_name_dicts)==1: extracted_name_dicts[0]["email"] = author_email for kwargs_dict in extracted_name_dicts: person = get_or_make_person(**kwargs_dict) self._save_contribution(person, "author")
def test_author_halt(self): test_string = """Fortran code by H. Akima<U+000a>R port by Albrecht Gebhardt <*****@*****.**><U+000a>aspline function by Thomas Petzoldt <*****@*****.**><U+000a>interp2xyz, enhancements and corrections by Martin Maechler <*****@*****.**>""" byline = Byline(test_string) response = byline.author_email_pairs() expected = None assert_equals(response, expected)
def test_author_email_pairs(self): for byline_string in self.test_bylines: byline = Byline(byline_string) print "\n{}\n{}\n".format(byline.author_email_pairs(), byline_string)
def test_clean_byline_string(self): byline = Byline(self.test_bylines[2]) expected = ' Corentin M Barbu [aut, cre], Sebastian Gibb [ctb]' assert_equals(byline._clean_byline(), expected)