feat(gateway): parse Apollo inventory and launch replies
Verify Data Plane / gateway (push) Successful in 1m58s
Verify Data Plane / gateway (push) Successful in 1m58s
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package gateway
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestApolloInventoryAndLaunchResponseRequireExactApplicationAndSuccess(t *testing.T) {
|
||||
inventory := []byte(`<root><App><ID>41</ID></App><App><ID>42</ID></App></root>`)
|
||||
if !apolloInventoryContains(inventory, "42") || apolloInventoryContains(inventory, "420") {
|
||||
t.Fatal("apolloInventoryContains() did not require an exact inventory ID")
|
||||
}
|
||||
if _, err := parseApolloLaunchResponse([]byte(`<root status_code="200"><sessionUrl0>rtspenc://apollo.test:47984</sessionUrl0></root>`)); err != nil {
|
||||
t.Fatalf("parseApolloLaunchResponse() error = %v", err)
|
||||
}
|
||||
if _, err := parseApolloLaunchResponse([]byte(`<root status_code="403"><sessionUrl0>rtspenc://apollo.test:47984</sessionUrl0></root>`)); err == nil {
|
||||
t.Fatal("parseApolloLaunchResponse() accepted a denied launch")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user