def _check_emails_match(self, emails): emails.google = utils.convert_aliases(emails.google) emails.elvanto = utils.convert_aliases(emails.elvanto) here_not_on_google = set(emails.elvanto) - set(emails.google) on_google_not_here = set(emails.google) - set(emails.elvanto) if (len(here_not_on_google) + len(on_google_not_here)) > 0: logger.warning( 'Updated list of emails does not result in a match for %s.' ' Here, not on google: %s' ' On google, not here: %s', self.google_email, ','.join(sorted(here_not_on_google)), ','.join(sorted(on_google_not_here)), )
def test_convert_aliases_removes_googlemail(): emails = utils.convert_aliases([ '*****@*****.**', '*****@*****.**', '*****@*****.**', ]) assert emails == [ '*****@*****.**', '*****@*****.**', '*****@*****.**', ]
def test_convert_aliases_any_email(emails): utils.convert_aliases(emails)