fp/services/bright/test/support/fixtures/streams_fixtures.ex

43 lines
830 B
Elixir
Raw Normal View History

2025-01-03 14:45:35 +00:00
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(%{
ipfs_cid: "some ipfs_cid",
s3_cdn_url: "some s3_cdn_url",
2025-01-21 20:42:01 +00:00
torrent: "some torrent",
playlist_url: "some playlist_url",
thumbnail_url: "some thumbnail_url"
2025-01-03 14:45:35 +00:00
})
|> Bright.Streams.create_vod()
vod
end
2025-01-21 20:42:01 +00:00
2025-01-03 14:45:35 +00:00
end