test_events_v1.py 文件源码

python
阅读 15 收藏 0 点赞 0 评论 0

项目:monasca-events-api 作者: openstack 项目源码 文件源码
def test_should_pass_simple_event(self, bulk_processor):
        events_resource = _init_resource(self)
        events_resource._processor = bulk_processor
        unit_test_patch = os.path.dirname(__file__)
        json_file_path = 'event_template_json/req_simple_event.json'
        patch_to_req_simple_event_file = os.path.join(unit_test_patch,
                                                      json_file_path)
        with open(patch_to_req_simple_event_file, 'r') as fi:
            body = fi.read()
        self.simulate_request(
            path=ENDPOINT,
            method='POST',
            headers={
                'Content-Type': 'application/json',
                'X_ROLES': 'monasca'
            },
            body=body
        )
        self.assertEqual(falcon.HTTP_200, self.srmock.status)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号