17 lines
815 B
Go
17 lines
815 B
Go
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")
|
|
}
|
|
}
|