1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Tests.ObanHelpers do
18 def perform(%Oban.Job{} = job) do
19 res = apply(String.to_existing_atom("Elixir." <> job.worker), :perform, [job.args, job])
24 def perform(jobs) when is_list(jobs) do
25 for job <- jobs, do: perform(job)
28 def member?(%{} = job_args, jobs) when is_list(jobs) do
29 Enum.any?(jobs, fn job ->
30 member?(job_args, job.args)
34 def member?(%{} = test_attrs, %{} = attrs) do
37 fn {k, _v} -> member?(test_attrs[k], attrs[k]) end
41 def member?(x, y), do: x == y