本文整理匯總了Python中bzt.modules.blazemeter.BlazeMeterUploader._session方法的典型用法代碼示例。如果您正苦於以下問題:Python BlazeMeterUploader._session方法的具體用法?Python BlazeMeterUploader._session怎麽用?Python BlazeMeterUploader._session使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bzt.modules.blazemeter.BlazeMeterUploader
的用法示例。
在下文中一共展示了BlazeMeterUploader._session方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_no_notes_for_public_reporting
# 需要導入模塊: from bzt.modules.blazemeter import BlazeMeterUploader [as 別名]
# 或者: from bzt.modules.blazemeter.BlazeMeterUploader import _session [as 別名]
def test_no_notes_for_public_reporting(self):
mock = BZMock()
mock.mock_post.update({
'https://a.blazemeter.com/api/v4/sessions/1/terminate-external': {},
'https://data.blazemeter.com/submit.php?session_id=1&signature=None&test_id=1&user_id=1&pq=0&target=labels_bulk&update=1': {},
})
obj = BlazeMeterUploader()
obj.parameters['project'] = 'Proj name'
obj.settings['token'] = '' # public reporting
obj.settings['browser-open'] = 'none'
obj.engine = EngineEmul()
mock.apply(obj._user)
obj.prepare()
obj._session = Session(obj._user, {'id': 1, 'testId': 1, 'userId': 1})
obj._master = Master(obj._user, {'id': 1})
obj.engine.stopping_reason = ValueError('wrong value')
obj.aggregated_second(random_datapoint(10))
obj.kpi_buffer[-1][DataPoint.CUMULATIVE][''][KPISet.ERRORS] = [
{'msg': 'Forbidden', 'cnt': 10, 'type': KPISet.ERRTYPE_ASSERT, 'urls': [], KPISet.RESP_CODES: '111',
'tag': ""},
{'msg': 'Allowed', 'cnt': 20, 'type': KPISet.ERRTYPE_ERROR, 'urls': [], KPISet.RESP_CODES: '222'}]
obj.send_monitoring = False
obj.post_process()
# TODO: looks like this whole block of checks is useless
# check for note appending in _postproc_phase3()
reqs = [{'url': '', 'data': ''} for _ in range(4)] # add template for minimal size
reqs = (reqs + mock.requests)[-4:]
self.assertNotIn('api/v4/sessions/1', reqs[0]['url'])
self.assertNotIn('api/v4/sessions/1', reqs[1]['url'])
self.assertNotIn('api/v4/masters/1', reqs[2]['url'])
self.assertNotIn('api/v4/masters/1', reqs[3]['url'])
if reqs[1]['data']:
self.assertNotIn('ValueError: wrong value', reqs[1]['data'])
if reqs[3]['data']:
self.assertNotIn('ValueError: wrong value', reqs[3]['data'])