diff options
| author | Mark Felder <feld@FreeBSD.org> | 2020-08-07 14:55:22 -0500 | 
|---|---|---|
| committer | Mark Felder <feld@FreeBSD.org> | 2020-08-07 14:55:22 -0500 | 
| commit | 54e2af829377b3f21823548e5612bbbb41550432 (patch) | |
| tree | 0ad164ee09bba1a82560d192d71d14033f70b195 /test/support | |
| parent | 474147a67a89f8bd92186dbda93d78d8e2045d52 (diff) | |
| parent | 39ca4a23c6c4a6cac9b277b8473ab9040a250e68 (diff) | |
| download | pleroma-54e2af829377b3f21823548e5612bbbb41550432.tar.gz pleroma-54e2af829377b3f21823548e5612bbbb41550432.zip  | |
Merge branch 'develop' into fix/ldap-auth-issues
Diffstat (limited to 'test/support')
| -rw-r--r-- | test/support/helpers.ex | 14 | ||||
| -rw-r--r-- | test/support/http_request_mock.ex | 8 | 
2 files changed, 20 insertions, 2 deletions
diff --git a/test/support/helpers.ex b/test/support/helpers.ex index 5cbf2e291..ecd4b1e18 100644 --- a/test/support/helpers.ex +++ b/test/support/helpers.ex @@ -17,9 +17,19 @@ defmodule Pleroma.Tests.Helpers do    defmacro clear_config(config_path, do: yield) do      quote do -      initial_setting = Config.get(unquote(config_path)) +      initial_setting = Config.fetch(unquote(config_path))        unquote(yield) -      on_exit(fn -> Config.put(unquote(config_path), initial_setting) end) + +      on_exit(fn -> +        case initial_setting do +          :error -> +            Config.delete(unquote(config_path)) + +          {:ok, value} -> +            Config.put(unquote(config_path), value) +        end +      end) +        :ok      end    end diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index 19a202654..eeeba7880 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -82,6 +82,14 @@ defmodule HttpRequestMock do       }}    end +  def get("https://patch.cx/objects/tesla_mock/poll_attachment", _, _, _) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/poll_attachment.json") +     }} +  end +    def get(          "https://mastodon.social/.well-known/webfinger?resource=https://mastodon.social/users/emelie",          _,  | 
