本文整理汇总了Python中jenkinsapi.jenkins.Requester.get_request_dict方法的典型用法代码示例。如果您正苦于以下问题:Python Requester.get_request_dict方法的具体用法?Python Requester.get_request_dict怎么用?Python Requester.get_request_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jenkinsapi.jenkins.Requester
的用法示例。
在下文中一共展示了Requester.get_request_dict方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_request_dict_wrong_headers
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_wrong_headers(self):
req = Requester('foo', 'bar')
with self.assertRaises(AssertionError) as na:
req.get_request_dict(
params={},
data=None,
headers='wrong'
)
self.assertTrue(str(na.exception) == "headers must be a dict, got 'wrong'")
示例2: test_get_request_dict_wrong_headers
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_wrong_headers():
req = Requester('foo', 'bar')
with pytest.raises(AssertionError) as na:
req.get_request_dict(
params={},
data=None,
headers='wrong'
)
assert "headers must be a dict, got 'wrong'" in str(na.value)
示例3: test_get_request_dict_wrong_params
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_wrong_params(self):
req = Requester('foo', 'bar')
with self.assertRaises(AssertionError) as na:
req.get_request_dict(
params='wrong',
data=None,
headers=None
)
self.assertTrue(na.exception.message == "Params must be a dict, got 'wrong'")
示例4: test_get_request_dict_wrong_headers
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_wrong_headers(self):
req = Requester('foo', 'bar')
with self.assertRaises(AssertionError) as na:
req_return = req.get_request_dict(url='http://', params={},
data=None, headers='wrong')
self.assertTrue(
na.exception.message=="headers must be a dict, got 'wrong'")
示例5: test_get_request_dict_auth
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_auth(self):
req = Requester('foo', 'bar')
req_return = req.get_request_dict(url='http://', params={}, data=None,
headers=None)
self.assertTrue(isinstance(req_return, dict))
self.assertTrue(req_return.get('auth'))
self.assertTrue(req_return['auth']==('foo', 'bar'))
示例6: test_get_request_dict_data_not_passed
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_data_not_passed(self):
req = Requester('foo', 'bar')
req_return = req.get_request_dict(url='http://',
params={'param': 'value'},
data=None, headers={'header': 'value'})
self.assertTrue(isinstance(req_return, dict))
self.assertFalse(req_return.get('data'))
示例7: test_get_request_dict_correct_headers
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_correct_headers(self):
req = Requester('foo', 'bar')
req_return = req.get_request_dict(url='http://',
params={'param': 'value'},
data=None, headers={'header': 'value'})
self.assertTrue(isinstance(req_return, dict))
self.assertTrue(req_return.get('headers'))
self.assertTrue(req_return['headers']=={'header': 'value'})
示例8: test_get_request_dict_nocookie
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_nocookie():
req = Requester('foo', 'bar')
req_return = req.get_request_dict(
params={},
data=None,
headers=None
)
assert isinstance(req_return, dict)
assert not req_return.get('headers')
示例9: test_get_request_dict_data_passed
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_data_passed(self):
req = Requester('foo', 'bar')
req_return = req.get_request_dict(url='http://',
params={'param': 'value'},
data='some data', headers={'header': 'value'})
self.assertTrue(isinstance(req_return, dict))
print req_return.get('data')
self.assertTrue(req_return.get('data'))
self.assertTrue(req_return['data']=='some data')
示例10: test_get_request_dict_data_not_passed
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_data_not_passed():
req = Requester('foo', 'bar')
req_return = req.get_request_dict(
params={'param': 'value'},
data=None,
headers={'header': 'value'}
)
assert isinstance(req_return, dict)
assert req_return.get('data') is None
示例11: test_get_request_dict_auth
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_auth():
req = Requester('foo', 'bar')
req_return = req.get_request_dict(
params={},
data=None,
headers=None
)
assert isinstance(req_return, dict)
assert req_return.get('auth')
assert req_return['auth'] == ('foo', 'bar')
示例12: test_get_request_dict_correct_headers
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_correct_headers():
req = Requester('foo', 'bar')
req_return = req.get_request_dict(
params={'param': 'value'},
data=None,
headers={'header': 'value'}
)
assert isinstance(req_return, dict)
assert req_return.get('headers')
assert req_return['headers'] == {'header': 'value'}
示例13: test_get_request_dict_correct_params
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_correct_params(self):
req = Requester('foo', 'bar')
req_return = req.get_request_dict(
params={'param': 'value'},
data=None,
headers=None
)
self.assertTrue(isinstance(req_return, dict))
self.assertTrue(req_return.get('params'))
self.assertEqual(req_return['params'], {'param': 'value'})
示例14: test_get_request_dict_updatecookie
# 需要导入模块: from jenkinsapi.jenkins import Requester [as 别名]
# 或者: from jenkinsapi.jenkins.Requester import get_request_dict [as 别名]
def test_get_request_dict_updatecookie():
req = Requester('foo', 'bar')
req_return = req.get_request_dict(
params={},
data=None,
headers={'key': 'value'}
)
assert isinstance(req_return, dict)
assert req_return.get('headers')
assert req_return.get('headers').get('key')
assert req_return.get('headers').get('key') == 'value'
assert req_return.get('headers').get('Cookie')
assert req_return.get('headers').get('Cookie') == 'FAKE'