本文整理汇总了Python中autojenkins.Jenkins.create方法的典型用法代码示例。如果您正苦于以下问题:Python Jenkins.create方法的具体用法?Python Jenkins.create怎么用?Python Jenkins.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autojenkins.Jenkins
的用法示例。
在下文中一共展示了Jenkins.create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestJenkins
# 需要导入模块: from autojenkins import Jenkins [as 别名]
# 或者: from autojenkins.Jenkins import create [as 别名]
#.........这里部分代码省略.........
def checks_last_build_info(self, response):
self.check_results(
response,
[(('timestamp',), 1330941036216L),
(('number',), 1783),
(('result',), 'FAILURE'),
(('changeSet', 'kind'), 'svn'),
])
def checks_last_build_report(self, response):
self.check_results(
response,
[(('duration',), 692.3089),
(('failCount',), 1),
(('suites', 0, 'name'), 'org.apache.solr.BasicFunctionalityTest'),
])
def checks_last_success(self, response):
self.check_results(
response,
[(('result',), 'SUCCESS'),
(('building',), False),
(('artifacts', 0, 'displayPath'),
'apache-solr-4.0-2012-02-29_09-07-30-src.tgz'),
])
def checks_get_config_xml(self, response):
self.assertTrue(response.startswith('<?xml'))
self.assertTrue(response.endswith('</project>'))
# TODO: test job creation, and set_config_xml
def test_create(self, requests):
requests.post.return_value = mock_response()
config_xml = path.join(fixture_path, 'create_copy.txt')
self.jenkins.create('job', config_xml, value='2')
CFG = "<value>2</value><disabled>true</disabled>"
requests.post.assert_called_once_with(
'http://jenkins/createItem',
auth=None,
headers={'Content-Type': 'application/xml'},
params={'name': 'job'},
data=CFG,
verify=True)
def test_create_copy(self, requests):
requests.get.return_value = mock_response('create_copy.txt')
requests.post.return_value = mock_response()
self.jenkins.create_copy('job', 'template', value='2')
CFG = "<value>2</value><disabled>false</disabled>"
requests.post.assert_called_once_with(
'http://jenkins/createItem',
auth=None,
headers={'Content-Type': 'application/xml'},
params={'name': 'job'},
data=CFG,
verify=True)
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',