Live video on the AT Protocol
1package media
2
3import (
4 "context"
5 "path/filepath"
6 "runtime"
7 "testing"
8
9 "github.com/stretchr/testify/require"
10 "stream.place/streamplace/pkg/atproto"
11 "stream.place/streamplace/pkg/bus"
12 "stream.place/streamplace/pkg/config"
13 ct "stream.place/streamplace/pkg/config/configtesting"
14 "stream.place/streamplace/pkg/model"
15)
16
17func getFixture(name string) string {
18 _, filename, _, _ := runtime.Caller(0)
19 dir := filepath.Dir(filename)
20 return filepath.Join(dir, "..", "..", "test", "fixtures", name)
21}
22
23func getStaticTestMediaManager(t *testing.T) (*MediaManager, MediaSigner) {
24 mod, err := model.MakeDB(":memory:")
25 require.NoError(t, err)
26 // signer, err := c2pa.MakeStaticSigner(eip712test.KeyBytes)
27 require.NoError(t, err)
28 if err != nil {
29 panic(err)
30 }
31 cli := ct.CLI(t, &config.CLI{
32 TAURL: "http://timestamp.digicert.com",
33 AllowedStreams: []string{"did:key:zQ3shhoPCrDZWE8CryCEHYCrb1x8mCkr2byTkF5EGJT7dgazC"},
34 })
35 atsync := &atproto.ATProtoSynchronizer{
36 CLI: cli,
37 Model: mod,
38 StatefulDB: nil, // Test doesn't need StatefulDB for now
39 Bus: bus.NewBus(),
40 }
41 mm, err := MakeMediaManager(context.Background(), cli, nil, mod, bus.NewBus(), atsync)
42 require.NoError(t, err)
43 // ms, err := MakeMediaSigner(context.Background(), cli, "test-person", signer)
44 // require.NoError(t, err)
45 return mm, nil
46}