mirror of
https://github.com/mautrix/whatsapp.git
synced 2026-08-24 04:54:56 -04:00
33 lines
767 B
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)
|
|
}
|
|
}
|
|
}
|