コード例 #1
0
ファイル: models.py プロジェクト: monty5811/elvanto_mail_sync
    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)),
            )
コード例 #2
0
def test_convert_aliases_removes_googlemail():
    emails = utils.convert_aliases([
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
    ])
    assert emails == [
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
    ]
コード例 #3
0
def test_convert_aliases_any_email(emails):
    utils.convert_aliases(emails)