MCPcopy Create free account
hub / github.com/dinofizz/diskplayer / TestPlayUriTransferPlaybackPauseError

Function TestPlayUriTransferPlaybackPauseError

diskplayer_test.go:151–182  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestPlayUriTransferPlaybackPauseError(t *testing.T) {
152 const n = "test_device_name"
153 viper.Set("spotify.device_name", n)
154
155 m := new(mocks.Client)
156
157 ds := []spotify.PlayerDevice{
158 {
159 ID: "ANOTHER_TEST_ID",
160 Active: true,
161 Restricted: false,
162 Name: "another_device_name",
163 Type: "",
164 Volume: 0,
165 },
166 {
167 ID: "TEST_ID",
168 Active: false,
169 Restricted: false,
170 Name: n,
171 Type: "",
172 Volume: 0,
173 },
174 }
175
176 m.On("PlayerDevices").Return(ds, nil)
177 const e = "pause error"
178 m.On("Pause").Return(errors.New(e))
179
180 err := PlayUri(m, "foobar")
181 assert.EqualError(t, err, e)
182}
183
184func TestPlayUriTransferPlaybackTransferError(t *testing.T) {
185 const n = "test_device_name"

Callers

nothing calls this directly

Calls 1

PlayUriFunction · 0.85

Tested by

no test coverage detected