Exemplo n.º 1
0
 def test_regular_playstates(self):
     self.assertEqual(DeviceState.Idle, playstate(PLAY_STATE_IDLE))
     self.assertEqual(DeviceState.Loading, playstate(PLAY_STATE_LOADING))
     self.assertEqual(DeviceState.Stopped, playstate(PLAY_STATE_STOPPED))
     self.assertEqual(DeviceState.Paused, playstate(PLAY_STATE_PAUSED))
     self.assertEqual(DeviceState.Playing, playstate(PLAY_STATE_PLAYING))
     self.assertEqual(DeviceState.Seeking, playstate(PLAY_STATE_FORWARD))
     self.assertEqual(DeviceState.Seeking, playstate(PLAY_STATE_BACKWARD))
Exemplo n.º 2
0
def test_regular_playstates():
    assert DeviceState.Idle == playstate(PLAY_STATE_IDLE)
    assert DeviceState.Loading == playstate(PLAY_STATE_LOADING)
    assert DeviceState.Stopped == playstate(PLAY_STATE_STOPPED)
    assert DeviceState.Paused == playstate(PLAY_STATE_PAUSED)
    assert DeviceState.Playing == playstate(PLAY_STATE_PLAYING)
    assert DeviceState.Seeking == playstate(PLAY_STATE_FORWARD)
    assert DeviceState.Seeking == playstate(PLAY_STATE_BACKWARD)
Exemplo n.º 3
0
 def test_device_state_no_media(self):
     # This test should not really be here as "None" is in reality not a
     # valid value. But it is supported nonetheless because that makes
     # usage nicer. None means that the field is not included in a
     # server response, which matches the behavior of dmap.first.
     self.assertEqual(DeviceState.Idle, playstate(None))
Exemplo n.º 4
0
 def test_unknown_playstate_throws(self):
     with self.assertRaises(exceptions.UnknownPlayStateError):
         playstate(99999)
Exemplo n.º 5
0
 def device_state(self):
     """Device state, e.g. playing or paused."""
     state = parser.first(self.playstatus, "cmst", "caps")
     return daap.playstate(state)
Exemplo n.º 6
0
def test_unknown_playstate_throws():
    with pytest.raises(exceptions.UnknownPlayStateError):
        playstate(99999)