浏览代码

Merge branch 'bugfix/log_non_implemented_mocks' into 'develop'

HttpRequestMock: Log non-implemented mock responses

Closes #1088

See merge request pleroma/pleroma!1416
tags/v1.1.4
rinpatch 4 年前
父节点
当前提交
5853d9c843
共有 1 个文件被更改,包括 12 次插入6 次删除
  1. +12
    -6
      test/support/http_request_mock.ex

+ 12
- 6
test/support/http_request_mock.ex 查看文件

@@ -17,9 +17,12 @@ defmodule HttpRequestMock do
with {:ok, res} <- apply(__MODULE__, method, [url, query, body, headers]) do
res
else
{_, _r} = error ->
# Logger.warn(r)
error
error ->
with {:error, message} <- error do
Logger.warn(message)
end

{_, _r} = error
end
end

@@ -970,7 +973,7 @@ defmodule HttpRequestMock do

def get(url, query, body, headers) do
{:error,
"Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{
"Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{
inspect(headers)
}"}
end
@@ -1032,7 +1035,10 @@ defmodule HttpRequestMock do
}}
end

def post(url, _query, _body, _headers) do
{:error, "Not implemented the mock response for post #{inspect(url)}"}
def post(url, query, body, headers) do
{:error,
"Mock response not implemented for POST #{inspect(url)}, #{query}, #{inspect(body)}, #{
inspect(headers)
}"}
end
end

正在加载...
取消
保存