Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/notifications/test/parser.py

Issue 29500676: Issue 5456 - Add support to specify urlFilters in the notification repository (Closed)
Patch Set: Added tests for urlFilters Created Sept. 21, 2017, 8:14 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/notifications/parser.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/notifications/test/parser.py
diff --git a/sitescripts/notifications/test/parser.py b/sitescripts/notifications/test/parser.py
index e5b5e37f7025779f93e1098c3d2e2f8f6c4aa8de..84f1c04c733111b6fa6fe30a17916b9d039c7aa4 100644
--- a/sitescripts/notifications/test/parser.py
+++ b/sitescripts/notifications/test/parser.py
@@ -154,6 +154,21 @@ end = %s
self.assertEqual(notifications[2]['severity'], 'normal')
self.assertEqual(notifications[3]['severity'], 'relentless')
+ def test_urls(self):
+ self.notification_to_load = [
+ ('1', '\nurls = adblockplus.org\n'),
+ ('1', '\nurls = adblockplus.org eyeo.com\n'),
+ ]
+ notifications = parser.load_notifications()
+
+ assert len(notifications) == 2
+
+ self.assertEqual(
Vasily Kuznetsov 2017/09/21 09:44:10 These following two asserts would look even better
wspee 2017/09/21 10:11:34 Done.
+ notifications[0]['urlFilters'], ['ADBLOCKPLUS.ORG^$document'])
+ self.assertEqual(notifications[1]['urlFilters'], [
+ 'ADBLOCKPLUS.ORG^$document',
+ 'EYEO.COM^$document'])
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « sitescripts/notifications/parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld