logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma

web_push_http_client_mock.ex (623B)


  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. defmodule Pleroma.Web.WebPushHttpClientMock do
  5. def get(url, headers \\ [], options \\ []) do
  6. {
  7. res,
  8. %Tesla.Env{status: status}
  9. } = Pleroma.HTTP.request(:get, url, "", headers, options)
  10. {res, %{status_code: status}}
  11. end
  12. def post(url, body, headers \\ [], options \\ []) do
  13. {
  14. res,
  15. %Tesla.Env{status: status}
  16. } = Pleroma.HTTP.request(:post, url, body, headers, options)
  17. {res, %{status_code: status}}
  18. end
  19. end