Add tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
90f91168f7
commit
90f590788c
5 changed files with 97 additions and 4 deletions
22
test/support/translation_mock.ex
Normal file
22
test/support/translation_mock.ex
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule TranslationMock do
|
||||
alias Pleroma.Translation.Service
|
||||
|
||||
@behaviour Service
|
||||
|
||||
@impl Service
|
||||
def configured?, do: true
|
||||
|
||||
@impl Service
|
||||
def translate(content, source_language, _target_language) do
|
||||
{:ok,
|
||||
%{
|
||||
content: content |> String.reverse(),
|
||||
detected_source_language: source_language,
|
||||
provider: "TranslationMock"
|
||||
}}
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue