| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 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 BaseTryJobTest(unittest.TestCase): |
| 12 def testWfTryJobStatusIsCompleted(self): | 12 |
| 13 def testTryJobStatusIsCompleted(self): |
| 13 for status in (analysis_status.COMPLETED, analysis_status.ERROR): | 14 for status in (analysis_status.COMPLETED, analysis_status.ERROR): |
| 14 try_job = WfTryJob.Create('m', 'b', 123) | 15 try_job = WfTryJob.Create('m', 'b', 123) |
| 15 try_job.status = status | 16 try_job.status = status |
| 16 self.assertTrue(try_job.completed) | 17 self.assertTrue(try_job.completed) |
| 17 | 18 |
| 18 def testWfTryJobStatusIsNotCompleted(self): | 19 def testTryJobStatusIsNotCompleted(self): |
| 19 for status in (analysis_status.PENDING, analysis_status.RUNNING): | 20 for status in (analysis_status.PENDING, analysis_status.RUNNING): |
| 20 try_job = WfTryJob.Create('m', 'b', 123) | 21 try_job = WfTryJob.Create('m', 'b', 123) |
| 21 try_job.status = status | 22 try_job.status = status |
| 22 self.assertFalse(try_job.completed) | 23 self.assertFalse(try_job.completed) |
| 23 | 24 |
| 24 def testWfTryJobStatusIsFailed(self): | 25 def testTryJobStatusIsFailed(self): |
| 25 try_job = WfTryJob.Create('m', 'b', 123) | 26 try_job = WfTryJob.Create('m', 'b', 123) |
| 26 try_job.status = analysis_status.ERROR | 27 try_job.status = analysis_status.ERROR |
| 27 self.assertTrue(try_job.failed) | 28 self.assertTrue(try_job.failed) |
| 28 | 29 |
| 29 def testWfTryJobStatusIsNotFailed(self): | 30 def testTryJobStatusIsNotFailed(self): |
| 30 for status in (analysis_status.PENDING, analysis_status.RUNNING, | 31 for status in (analysis_status.PENDING, analysis_status.RUNNING, |
| 31 analysis_status.COMPLETED): | 32 analysis_status.COMPLETED): |
| 32 try_job = WfTryJob.Create('m', 'b', 123) | 33 try_job = WfTryJob.Create('m', 'b', 123) |
| 33 try_job.status = status | 34 try_job.status = status |
| 34 self.assertFalse(try_job.failed) | 35 self.assertFalse(try_job.failed) |
| OLD | NEW |