Update Copyrights
[akkoma] / test / support / web_push_http_client_mock.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.WebPushHttpClientMock do
6 def get(url, headers \\ [], options \\ []) do
7 {
8 res,
9 %Tesla.Env{status: status}
10 } = Pleroma.HTTP.request(:get, url, "", headers, options)
11
12 {res, %{status_code: status}}
13 end
14
15 def post(url, body, headers \\ [], options \\ []) do
16 {
17 res,
18 %Tesla.Env{status: status}
19 } = Pleroma.HTTP.request(:post, url, body, headers, options)
20
21 {res, %{status_code: status}}
22 end
23 end