Permalink
Browse files

Add test for transfer

  • Loading branch information...
1 parent 78c9ced commit 95320b945d85fa4d07dbe43e7ad196bf434086a1 Carles Barrobés committed Jul 12, 2012
Showing with 13 additions and 0 deletions.
  1. +12 −0 autojenkins/tests/test_unit_jobs.py
  2. +1 −0 autojenkins/tests/transfer.txt
@@ -144,6 +144,18 @@ def test_create_copy(self, requests):
params={'name': 'job'},
data=CFG)
+ def test_transfer(self, requests):
+ requests.get.return_value = mock_response('transfer.txt')
+ requests.post.return_value = mock_response()
+ self.jenkins.transfer('job', 'http://jenkins2')
+ CFG = load_fixture('transfer.txt')
+ requests.post.assert_called_once_with(
+ 'http://jenkins2/createItem',
+ auth=None,
+ headers={'Content-Type': 'application/xml'},
+ params={'name': 'job'},
+ data=CFG)
+
@data(
('build', 'job/{0}/build'),
('delete', 'job/{0}/doDelete'),
@@ -0,0 +1 @@
+<job>Transfer test</job>

0 comments on commit 95320b9

Please sign in to comment.