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

Unified Diff: appengine/findit/model/test/wf_try_job_test.py

Issue 2586483003: [Findit] Adding build model for flake try jobs (Closed)
Patch Set: Fixing whitespace Created 4 years 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 | « appengine/findit/model/test/base_try_job_test.py ('k') | appengine/findit/model/wf_try_job.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/test/wf_try_job_test.py
diff --git a/appengine/findit/model/test/wf_try_job_test.py b/appengine/findit/model/test/wf_try_job_test.py
index ac281783f86865c186b97434627337d4b999e857..eb5e870972c6a2a165d8851a5c93a5f1f64ddbea 100644
--- a/appengine/findit/model/test/wf_try_job_test.py
+++ b/appengine/findit/model/test/wf_try_job_test.py
@@ -2,33 +2,28 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import unittest
+from gae_libs.testcase import TestCase
-from model import analysis_status
from model.wf_try_job import WfTryJob
-class WfTryJobTest(unittest.TestCase):
- def testWfTryJobStatusIsCompleted(self):
- for status in (analysis_status.COMPLETED, analysis_status.ERROR):
- try_job = WfTryJob.Create('m', 'b', 123)
- try_job.status = status
- self.assertTrue(try_job.completed)
+class WfTryJobTest(TestCase):
- def testWfTryJobStatusIsNotCompleted(self):
- for status in (analysis_status.PENDING, analysis_status.RUNNING):
- try_job = WfTryJob.Create('m', 'b', 123)
- try_job.status = status
- self.assertFalse(try_job.completed)
-
- def testWfTryJobStatusIsFailed(self):
+ def testCreate(self):
try_job = WfTryJob.Create('m', 'b', 123)
- try_job.status = analysis_status.ERROR
- self.assertTrue(try_job.failed)
-
- def testWfTryJobStatusIsNotFailed(self):
- for status in (analysis_status.PENDING, analysis_status.RUNNING,
- analysis_status.COMPLETED):
- try_job = WfTryJob.Create('m', 'b', 123)
- try_job.status = status
- self.assertFalse(try_job.failed)
+ self.assertEqual([], try_job.try_job_ids)
+ self.assertEqual([], try_job.compile_results)
+ self.assertEqual([], try_job.test_results)
+
+ def testGet(self):
+ master_name = 'm'
+ builder_name = 'b'
+ build_number = 123
+ try_job_id = 'try_job_id'
+
+ try_job_before = WfTryJob.Create(master_name, builder_name, build_number)
+ try_job_before.try_job_ids = [try_job_id]
+ try_job_before.put()
+
+ try_job_after = WfTryJob.Get(master_name, builder_name, build_number)
+ self.assertEqual([try_job_id], try_job_after.try_job_ids)
« no previous file with comments | « appengine/findit/model/test/base_try_job_test.py ('k') | appengine/findit/model/wf_try_job.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698