| Index: dashboard/dashboard/add_point_queue_test.py
|
| diff --git a/dashboard/dashboard/add_point_queue_test.py b/dashboard/dashboard/add_point_queue_test.py
|
| index 9615206496b5387dfe0b0efc53f75b35288e7782..fef23656a53bdd17fa16cb05ce2b9acf6e364239 100644
|
| --- a/dashboard/dashboard/add_point_queue_test.py
|
| +++ b/dashboard/dashboard/add_point_queue_test.py
|
| @@ -7,6 +7,7 @@ import unittest
|
| from dashboard import add_point_queue
|
| from dashboard.common import testing_common
|
| from dashboard.common import utils
|
| +from dashboard.models import anomaly
|
| from dashboard.models import graph_data
|
| from dashboard.models import stoppage_alert
|
|
|
| @@ -23,7 +24,7 @@ class GetOrCreateAncestorsTest(testing_common.TestCase):
|
| graph_data.TestMetadata(id='ChromiumPerf/win7/dromaeo',).put()
|
| graph_data.TestMetadata(id='ChromiumPerf/win7/dromaeo/dom').put()
|
| graph_data.TestMetadata(id='ChromiumPerf/win7/dromaeo/dom/modify').put()
|
| - actual_parent = add_point_queue._GetOrCreateAncestors(
|
| + actual_parent = add_point_queue.GetOrCreateAncestors(
|
| 'ChromiumPerf', 'win7', 'dromaeo/dom/modify')
|
| self.assertEqual(
|
| 'ChromiumPerf/win7/dromaeo/dom/modify', actual_parent.key.id())
|
| @@ -35,7 +36,7 @@ class GetOrCreateAncestorsTest(testing_common.TestCase):
|
| self.assertEqual(3, len(graph_data.TestMetadata.query().fetch()))
|
|
|
| def testGetOrCreateAncestors_CreatesAllExpectedEntities(self):
|
| - parent = add_point_queue._GetOrCreateAncestors(
|
| + parent = add_point_queue.GetOrCreateAncestors(
|
| 'ChromiumPerf', 'win7', 'dromaeo/dom/modify')
|
| self.assertEqual('ChromiumPerf/win7/dromaeo/dom/modify', parent.key.id())
|
| # Check that all the Bot and TestMetadata entities were correctly added.
|
| @@ -69,11 +70,17 @@ class GetOrCreateAncestorsTest(testing_common.TestCase):
|
| alert_key = stoppage_alert.CreateStoppageAlert(test, row).put()
|
| test.stoppage_alert = alert_key
|
| test.put()
|
| - add_point_queue._GetOrCreateAncestors('M', 'b', 'suite/foo')
|
| + add_point_queue.GetOrCreateAncestors('M', 'b', 'suite/foo')
|
| self.assertIsNone(test.key.get().stoppage_alert)
|
| self.assertTrue(alert_key.get().recovered)
|
| self.assertIsNotNone(alert_key.get().last_row_timestamp)
|
|
|
| + def testGetOrCreateAncestors_RespectsImprovementDirectionForNewTest(self):
|
| + test = add_point_queue.GetOrCreateAncestors(
|
| + 'M', 'b', 'suite/foo', units='bogus',
|
| + improvement_direction=anomaly.UP)
|
| + self.assertEqual(anomaly.UP, test.improvement_direction)
|
| +
|
|
|
| if __name__ == '__main__':
|
| unittest.main()
|
|
|