Permalink
Browse files

Add tests for the run module

  • Loading branch information...
1 parent f0bc23b commit b8bfba5bacd7435475d9afdc7d63d3fa5dc4d4e7 Carles Barrobés committed Jun 29, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 autojenkins/tests/test_run.py
@@ -0,0 +1,18 @@
+from mock import Mock, patch
+from nose.tools import assert_equals
+
+from autojenkins.run import delete_jobs
+
+
+@patch('autojenkins.run.Jenkins')
+def test_delete_jobs(jenkins):
+ jenkins.return_value = Mock()
+ delete_jobs('http://jenkins', ['hello', 'bye'])
+ jenkins.assert_called_with('http://jenkins')
+ assert_equals(2, jenkins.return_value.delete.call_count)
+ assert_equals(
+ [(('hello',), {}), (('bye',), {})],
+ jenkins.return_value.delete.call_args_list)
+
+
+

0 comments on commit b8bfba5

Please sign in to comment.