test_mbox_author.py 965 B

1234567891011121314151617181920212223242526272829
  1. # Checks related to the patch's author
  2. #
  3. # Copyright (C) 2016 Intel Corporation
  4. #
  5. # SPDX-License-Identifier: GPL-2.0-only
  6. import base
  7. import pyparsing
  8. class Author(base.Base):
  9. auh_email = 'auh@auh.yoctoproject.org'
  10. invalids = [pyparsing.Regex("^Upgrade Helper.+"),
  11. pyparsing.Regex(auh_email),
  12. pyparsing.Regex("uh@not\.set"),
  13. pyparsing.Regex("\S+@example\.com")]
  14. def test_author_valid(self):
  15. for commit in self.commits:
  16. for invalid in self.invalids:
  17. if invalid.search_string(commit.author):
  18. self.fail('Invalid author %s. Resend the series with a valid patch author' % commit.author, commit=commit)
  19. def test_non_auh_upgrade(self):
  20. for commit in self.commits:
  21. if self.auh_email in commit.payload:
  22. self.fail('Invalid author %s. Resend the series with a valid patch author' % self.auh_email, commit=commit)