HTTPSignaturePlugTest: Rewrite to use mox.
This commit is contained in:
parent
3b4be5daa2
commit
f5978da676
7 changed files with 144 additions and 113 deletions
|
|
@ -116,6 +116,7 @@ defmodule Pleroma.DataCase do
|
|||
Mox.stub_with(Pleroma.Web.FederatorMock, Pleroma.Web.Federator)
|
||||
Mox.stub_with(Pleroma.ConfigMock, Pleroma.Config)
|
||||
Mox.stub_with(Pleroma.StaticStubbedConfigMock, Pleroma.Test.StaticConfig)
|
||||
Mox.stub_with(Pleroma.StubbedHTTPSignaturesMock, Pleroma.Test.HTTPSignaturesProxy)
|
||||
end
|
||||
|
||||
def ensure_local_uploader(context) do
|
||||
|
|
|
|||
9
test/support/http_signatures_proxy.ex
Normal file
9
test/support/http_signatures_proxy.ex
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
defmodule Pleroma.Test.HTTPSignaturesProxy do
|
||||
@behaviour Pleroma.HTTPSignaturesAPI
|
||||
|
||||
@impl true
|
||||
defdelegate validate_conn(conn), to: HTTPSignatures
|
||||
|
||||
@impl true
|
||||
defdelegate signature_for_conn(conn), to: HTTPSignatures
|
||||
end
|
||||
|
|
@ -28,6 +28,7 @@ Mox.defmock(Pleroma.Web.FederatorMock, for: Pleroma.Web.Federator.Publishing)
|
|||
Mox.defmock(Pleroma.ConfigMock, for: Pleroma.Config.Getting)
|
||||
Mox.defmock(Pleroma.UnstubbedConfigMock, for: Pleroma.Config.Getting)
|
||||
Mox.defmock(Pleroma.StaticStubbedConfigMock, for: Pleroma.Config.Getting)
|
||||
Mox.defmock(Pleroma.StubbedHTTPSignaturesMock, for: Pleroma.HTTPSignaturesAPI)
|
||||
|
||||
Mox.defmock(Pleroma.LoggerMock, for: Pleroma.Logging)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue