def test_play_entry_with_valid_id_works(self):
     entry = Mock()
     source = Mock()
     self.player.props.queue_source = source
     self.player.get_playing.return_value = (None, True)
     self.db.entry_lookup_by_id.return_value = entry
     rbplayer = RBHandler(self.shell)
     rbplayer.play_entry(1)
     self.player.play_entry.assert_called_with(entry, source)
 def test_play_entry_with_none_as_id_fails(self):
     rbplayer = RBHandler(self.shell)
     with self.assertRaises(Exception):
         rbplayer.play_entry(None)
 def test_play_entry_with_invalid_id_fails(self):
     rbplayer = RBHandler(self.shell)
     with self.assertRaises(Exception):
         rbplayer.play_entry("invalid")