nimeijian 2020-02-15
这里是把传入的请求数据作为响应值返回
# -*- coding: utf-8 -*- # @Time : 2020/2/15 9:47 # @File : do_mock_18.py # @Author: Hero Liu # 接口不可用,模拟返回响应数据 import mock def mock_test(mock_method, url, method, request_data, response_data, header=None): mock_method = mock.Mock(return_value=response_data) res = mock_method(url, method, request_data, header) return res