Change assert_ checks to assertEquals/NotEquals/True/False...#2086
Change assert_ checks to assertEquals/NotEquals/True/False...#2086tardyp merged 5 commits intobuildbot:masterfrom
Conversation
Current coverage is
|
|
|
||
| # The first time, it just learns the change to start at. | ||
| self.assert_(self.changesource.last_change is None) | ||
| self.assertTrue(self.changesource.last_change is None) |
There was a problem hiding this comment.
Can we use self.assertIsNone(self.changesource.last_change) here?
|
Modern versions of |
|
twisted TestCase is a subclass of unittest TestCase.. |
| else: | ||
| self.assert_(False, "No downloadFile command found") | ||
| else: | ||
| raise ValueError("No downloadFile command found") |
There was a problem hiding this comment.
got confused. Also didn't realize there was the for...else: syntax.
| self.assertEqual(b.results, SUCCESS) | ||
| self.assert_(('startStep', (self.workerforbuilder.worker.conn,), {}) | ||
| in step.method_calls) | ||
| self.assertIn(('startStep', (self.workerforbuilder.worker.conn,), {}), |
There was a problem hiding this comment.
This is a good candidates for refactor in TestCase base classe (we use a tiny abstract class between unittest.TestCase and our tests, so we can implement our how missing assert* methods)...
self.assertMethodCalledWith(step, ('startStep', (self.workerforbuilder.worker.conn,), {}),
|
By the way, |
|
in this case, lets merge it. |
This is for ticket 2521.