Permalink
Browse files

Test is_building

  • Loading branch information...
1 parent eaf45c6 commit 8f4442f1c82ea7713985005f646eb3ca554b12f4 Carles Barrobés committed Jul 12, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 autojenkins/tests/test_unit_jobs.py
@@ -222,6 +222,14 @@ def test_wait_for_build(self, is_building, sys, time, requests):
self.assertEqual(2, time.sleep.call_count)
self.assertEqual(((3,), {}), time.sleep.call_args)
+ @patch('autojenkins.jobs.Jenkins.last_result')
+ @data(True, False)
+ def test_is_building(self, building, last_result, _):
+ last_result.return_value = {'building': building}
+ result = self.jenkins.is_building('name')
+ last_result.assert_called_once_with('name')
+ self.assertEqual(building, result)
+
def test_404_raises_http_not_found(self, requests):
http404_response = Mock()
http404_response.status_code = 404

0 comments on commit 8f4442f

Please sign in to comment.