-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
592e9e0
commit 9903c97
Showing
3 changed files
with
55 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package livekit | ||
|
||
import ( | ||
fmt "fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"gopkg.in/yaml.v3" | ||
) | ||
|
||
func TestUnmarshallRoomEgress(t *testing.T) { | ||
y := ` | ||
a: | ||
room: | ||
room_name: room name | ||
b: | ||
participant: | ||
file_outputs: | ||
- s3: | ||
access_key: key | ||
` | ||
|
||
obj := make(map[string]*RoomEgress) | ||
|
||
err := yaml.Unmarshal([]byte(y), &obj) | ||
|
||
fmt.Println(obj) | ||
|
||
require.NoError(t, err) | ||
require.Equal(t, 2, len(obj)) | ||
|
||
re := obj["a"] | ||
require.NotNil(t, re) | ||
require.Equal(t, re.Room.RoomName, "room name") | ||
|
||
re = obj["b"] | ||
require.NotNil(t, re) | ||
require.Equal(t, 1, len(re.Participant.FileOutputs)) | ||
require.Equal(t, "key", re.Participant.FileOutputs[0].Output.(*EncodedFileOutput_S3).S3.AccessKey) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters