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

44 lines
943 B
Elixir
Raw Permalink 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",
mux_asset_id: "some mux_asset_id",
mux_playback_id: "some mux_playback_id",
s3_bucket: "some s3_bucket",
s3_cdn_url: "some s3_cdn_url",
s3_key: "some s3_key",
s3_upload_id: "some s3_upload_id",
torrent: "some torrent"
})
|> Bright.Streams.create_vod()
vod
end
end