Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1132)

Unified Diff: app_test.py

Issue 143263025: Add support to change the status header for gatekeeper-ng. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chromium-build
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gatekeeper_mailer.py » ('j') | gatekeeper_mailer.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app_test.py
diff --git a/app_test.py b/app_test.py
index a6cece4c5157d54ed0ad42999f03ecf125751fd0..0db666e8a28a833d1be534c2e4e39696b88f3b66 100644
--- a/app_test.py
+++ b/app_test.py
@@ -528,6 +528,25 @@ class MailTestCase(GaeTestCase):
self.assertEqual(saw, expected)
+ def test_html_format_status(self):
+ import gatekeeper_mailer
+ status = ('Perf alert for "%(steps)s" on "%(builder_name)s"')
+ template = gatekeeper_mailer.MailTemplate(self.build_data['waterfall_url'],
+ self.build_data['build_url'],
+ self.build_data['project_name'],
+ 'test@chromium.org',
+ status=status)
+
+ _, html_content, _ = template.genMessageContent(self.build_data)
+
+ with open(os.path.join(self.test_dir, 'expected_status.html')) as f:
+ expected_html = ' '.join(f.read().splitlines())
+
+ saw = str(BeautifulSoup(html_content)).split()
+ expected = str(BeautifulSoup(expected_html)).split()
+
+ self.assertEqual(saw, expected)
+
def test_hmac_validation(self):
from mailer import Email
message = self.input_json['message']
« no previous file with comments | « no previous file | gatekeeper_mailer.py » ('j') | gatekeeper_mailer.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698