Revert(test): 撤销对 test_build_from_mapping.py 的修改

pull/21960/head
baonudesifeizhai 11 months ago
parent c34409cf58
commit 3d2f46a99f

@ -62,7 +62,7 @@ def mock_tool_file():
@pytest.fixture @pytest.fixture
def mock_http_head(): def mock_http_head():
def _mock_response(filename, size, content_type): def _mock_response(filename, size, content_type):
response = Response( return Response(
status_code=200, status_code=200,
headers={ headers={
"Content-Disposition": f'attachment; filename="{filename}"', "Content-Disposition": f'attachment; filename="{filename}"',
@ -70,8 +70,6 @@ def mock_http_head():
"Content-Type": content_type, "Content-Type": content_type,
}, },
) )
response.request = MagicMock()
return response
with patch("factories.file_factory.ssrf_proxy.head") as mock_head: with patch("factories.file_factory.ssrf_proxy.head") as mock_head:
mock_head.return_value = _mock_response("remote_test.jpg", 2048, "image/jpeg") mock_head.return_value = _mock_response("remote_test.jpg", 2048, "image/jpeg")

Loading…
Cancel
Save