MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / TestPlaybackControl

Function TestPlaybackControl

internal/integration/playback.go:49–76  ·  view source on GitHub ↗
(t *testing.T, s Server)

Source from the content-addressed store, hash-verified

47}
48
49func TestPlaybackControl(t *testing.T, s Server) {
50 key := ari.NewKey(ari.PlaybackKey, "pb1")
51
52 runTest("ok", t, s, func(t *testing.T, m *mock, cl ari.Client) {
53 m.Playback.On("Control", key, "op").Return(nil)
54
55 err := cl.Playback().Control(key, "op")
56 if err != nil {
57 t.Errorf("Unexpected error in Playback Control: %s", err)
58 }
59
60 m.Shutdown()
61
62 m.Playback.AssertCalled(t, "Control", key, "op")
63 })
64 runTest("err", t, s, func(t *testing.T, m *mock, cl ari.Client) {
65 m.Playback.On("Control", key, "op").Return(errors.New("error"))
66
67 err := cl.Playback().Control(key, "op")
68 if err == nil {
69 t.Errorf("Expected error in Playback Control: %s", err)
70 }
71
72 m.Shutdown()
73
74 m.Playback.AssertCalled(t, "Control", key, "op")
75 })
76}
77
78func TestPlaybackStop(t *testing.T, s Server) {
79 key := ari.NewKey(ari.PlaybackKey, "pb1")

Callers 2

TestPlaybackControlFunction · 0.92
TestPlaybackControlFunction · 0.92

Calls 4

runTestFunction · 0.85
ControlMethod · 0.80
PlaybackMethod · 0.80
NewMethod · 0.80

Tested by

no test coverage detected