Skip to content

Commit

Permalink
Test is_building
Browse files Browse the repository at this point in the history
  • Loading branch information
Carles Barrobés committed Jul 12, 2012
1 parent eaf45c6 commit 8f4442f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions autojenkins/tests/test_unit_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8f4442f

Please sign in to comment.