Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.6 kB · 53 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354package media
import ( "context" "path/filepath" "runtime" "testing"
"github.com/stretchr/testify/require" "stream.place/streamplace/pkg/atproto" "stream.place/streamplace/pkg/bus" "stream.place/streamplace/pkg/config" ct "stream.place/streamplace/pkg/config/configtesting" "stream.place/streamplace/pkg/localdb" "stream.place/streamplace/pkg/model" "stream.place/streamplace/pkg/statedb")
func getFixture(name string) string { _, filename, _, _ := runtime.Caller(0) dir := filepath.Dir(filename) return filepath.Join(dir, "..", "..", "test", "fixtures", name)}
func getStaticTestMediaManager(t *testing.T) (*MediaManager, MediaSigner) { mod, err := model.MakeDB(":memory:") require.NoError(t, err) ldb, err := localdb.MakeDB(":memory:") require.NoError(t, err) // signer, err := c2pa.MakeStaticSigner(eip712test.KeyBytes) require.NoError(t, err) if err != nil { panic(err) } cli := ct.CLI(t, &config.CLI{ TAURL: "http://timestamp.digicert.com", AllowedStreams: []string{"did:plc:2j2ounbiyi3ftihronlw5qhj"}, DBURL: ":memory:", }) statedb, err := statedb.MakeDB(context.Background(), cli, nil, mod) require.NoError(t, err) atsync := &atproto.ATProtoSynchronizer{ CLI: cli, Model: mod, StatefulDB: statedb, Bus: bus.NewBus(), } mm, err := MakeMediaManager(context.Background(), cli, nil, mod, bus.NewBus(), atsync, ldb) require.NoError(t, err) // ms, err := MakeMediaSigner(context.Background(), cli, "test-person", signer) // require.NoError(t, err) return mm, nil}