| Index: Tools/GardeningServer/internal_alerts_test.py
|
| diff --git a/Tools/GardeningServer/internal_alerts_test.py b/Tools/GardeningServer/internal_alerts_test.py
|
| index c771eb0896e08477621cb8860693bcccf2a0cfc5..e635ccc9df6832cf46a2e22342813f8f07ca16ae 100644
|
| --- a/Tools/GardeningServer/internal_alerts_test.py
|
| +++ b/Tools/GardeningServer/internal_alerts_test.py
|
| @@ -2,6 +2,7 @@
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| +import alerts
|
| import internal_alerts
|
| import json
|
| import random
|
| @@ -80,6 +81,19 @@ class InternalAlertsTest(unittest.TestCase):
|
| internal_alerts = json.loads(res.body)
|
| self.assertEqual(internal_alerts['alerts'], 'everything is OK')
|
|
|
| + def test_internal_alerts_stored_in_history_have_correct_key(self):
|
| + test_alerts1 = {'alerts': ['hello', 'world', '1']}
|
| + test_alerts2 = {'alerts': ['hello', 'world', '2']}
|
| + self.testapp.post('/internal-alerts',
|
| + {'content': json.dumps(test_alerts1)})
|
| + self.testapp.post('/internal-alerts',
|
| + {'content': json.dumps(test_alerts2)})
|
| + alerts_query = alerts.AlertsJSON.query().order(alerts.AlertsJSON.date)
|
| + stored_alerts = alerts_query.fetch(limit=3)
|
| + self.assertEqual(2, len(stored_alerts))
|
| + self.assertEqual(stored_alerts[0].key, 'internal-alerts')
|
| + self.assertEqual(stored_alerts[1].key, 'internal-alerts')
|
| +
|
| def test_large_number_of_internal_alerts(self):
|
| self.user_helper('tester@google.com', '123')
|
| # This generates ~2.5MB of JSON that compresses to ~750K. Real
|
|
|