Watch
1
0
Fork
You've already forked mautrix-whatsapp
0
mirror of https://github.com/mautrix/whatsapp.git synced 2026-08-24 04:54:56 -04:00
mautrix-whatsapp/pkg/connector/config_test.go

33 lines
767 B
Go

package connector
import (
"os"
"testing"
"go.yaml.in/yaml/v3"
)
func TestExampleConfigDoesNotAdvertiseUnsupportedVideoModes(t *testing.T) {
data, err := os.ReadFile("example-config.yaml")
if err != nil {
t.Fatal(err)
}
var config map[string]any
if err = yaml.Unmarshal(data, &config); err != nil {
t.Fatal(err)
}
voip, ok := config["voip"].(map[string]any)
if !ok {
t.Fatal("example config has no voip section")
}
video, ok := voip["video"].(map[string]any)
if !ok {
t.Fatal("example config has no voip.video section")
}
for _, unsupported := range []string{"require_h264", "allow_transcode"} {
if _, exists := video[unsupported]; exists {
t.Errorf("example config advertises unsupported voip.video.%s option", unsupported)
}
}
}