fp/apps/bright/test/support/fixtures/streams_fixtures.ex
CJ_Clippy aa75c224fc
Some checks failed
ci / build (push) Failing after 23m29s
ci / Tests & Checks (push) Failing after 3m32s
move services/bright to apps/bright
2025-02-10 08:16:50 -08:00

40 lines
793 B
Elixir

defmodule Bright.StreamsFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Bright.Streams` context.
"""
@doc """
Generate a stream.
"""
def stream_fixture(attrs \\ %{}) do
{:ok, stream} =
attrs
|> Enum.into(%{
date: ~U[2024-12-28 03:31:00Z],
notes: "some notes",
title: "some title"
})
|> Bright.Streams.create_stream()
stream
end
@doc """
Generate a vod.
"""
def vod_fixture(attrs \\ %{}) do
{:ok, vod} =
attrs
|> Enum.into(%{
s3_cdn_url: "some s3_cdn_url",
torrent: "some torrent",
playlist_url: "some playlist_url",
thumbnail_url: "some thumbnail_url"
})
|> Bright.Streams.create_vod()
vod
end
end