MCPcopy
hub / github.com/livekit/livekit / TestGetDataBlob

Function TestGetDataBlob

pkg/rtc/participant_data_blob_handler_test.go:223–238  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

221}
222
223func TestGetDataBlob(t *testing.T) {
224 p := newParticipantWithDataBlob(t, true, 0, 0)
225
226 key := genericKey("blob-1")
227 require.Nil(t, p.GetDataBlob(key))
228
229 blob := &livekit.DataBlob{
230 Key: key,
231 Contents: []byte("definition"),
232 }
233 p.dataBlob.Add(blob)
234 got := p.GetDataBlob(key)
235 require.NotNil(t, got)
236 require.Equal(t, key.String(), got.Key.String())
237 require.Equal(t, []byte("definition"), got.Contents)
238}
239
240func TestProcessGetDataBlobRequest(t *testing.T) {
241 t.Run("returns NOT_FOUND when publisher is nil", func(t *testing.T) {

Callers

nothing calls this directly

Calls 5

genericKeyFunction · 0.85
GetDataBlobMethod · 0.65
AddMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected