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

Side by Side Diff: appengine/findit/model/test/wf_try_job_test.py

Issue 1866883002: [Findit] A huge refactoring and some bug fixing. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix nit. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import unittest 5 import unittest
6 6
7 from model import wf_analysis_status 7 from model import analysis_status
8 from model.wf_try_job import WfTryJob 8 from model.wf_try_job import WfTryJob
9 9
10 10
11 class WfTryJobTest(unittest.TestCase): 11 class WfTryJobTest(unittest.TestCase):
12 def testWfTryJobStatusIsCompleted(self): 12 def testWfTryJobStatusIsCompleted(self):
13 for status in (wf_analysis_status.ANALYZED, wf_analysis_status.ERROR): 13 for status in (analysis_status.COMPLETED, analysis_status.ERROR):
14 try_job = WfTryJob.Create('m', 'b', 123) 14 try_job = WfTryJob.Create('m', 'b', 123)
15 try_job.status = status 15 try_job.status = status
16 self.assertTrue(try_job.completed) 16 self.assertTrue(try_job.completed)
17 17
18 def testWfTryJobStatusIsNotCompleted(self): 18 def testWfTryJobStatusIsNotCompleted(self):
19 for status in (wf_analysis_status.PENDING, wf_analysis_status.ANALYZING): 19 for status in (analysis_status.PENDING, analysis_status.RUNNING):
20 try_job = WfTryJob.Create('m', 'b', 123) 20 try_job = WfTryJob.Create('m', 'b', 123)
21 try_job.status = status 21 try_job.status = status
22 self.assertFalse(try_job.completed) 22 self.assertFalse(try_job.completed)
23 23
24 def testWfTryJobStatusIsFailed(self): 24 def testWfTryJobStatusIsFailed(self):
25 try_job = WfTryJob.Create('m', 'b', 123) 25 try_job = WfTryJob.Create('m', 'b', 123)
26 try_job.status = wf_analysis_status.ERROR 26 try_job.status = analysis_status.ERROR
27 self.assertTrue(try_job.failed) 27 self.assertTrue(try_job.failed)
28 28
29 def testWfTryJobStatusIsNotFailed(self): 29 def testWfTryJobStatusIsNotFailed(self):
30 for status in (wf_analysis_status.PENDING, wf_analysis_status.ANALYZING, 30 for status in (analysis_status.PENDING, analysis_status.RUNNING,
31 wf_analysis_status.ANALYZED): 31 analysis_status.COMPLETED):
32 try_job = WfTryJob.Create('m', 'b', 123) 32 try_job = WfTryJob.Create('m', 'b', 123)
33 try_job.status = status 33 try_job.status = status
34 self.assertFalse(try_job.failed) 34 self.assertFalse(try_job.failed)
OLDNEW
« no previous file with comments | « appengine/findit/model/test/wf_analysis_test.py ('k') | appengine/findit/model/versioned_model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698