Exemplo n.º 1
0
    def testGetNextSongRandom(self):
        song = self.addSong(artist=self.addArtist(), filename=__file__)

        songs_api = api.songs()
        result = songs_api.getNextSong()

        self.assertEquals(result, song)

        # check if song has been added to history
        history_api = api.history()
        result = history_api.index()

        self.assertEqual(result["itemList"][0]["id"], song.id)
Exemplo n.º 2
0
    def testGetNextSongFromQueue(self):
        song = self.addSong(artist=self.addArtist(), filename=__file__)

        # add to queue
        queue_api = api.queue()
        queue_api.set_user_id(self.user.id)
        queue_api.add(song.id)

        # get next song
        songs_api = api.songs()
        result = songs_api.getNextSong()
        self.assertEquals(result, song)

        # check if song has been added to history
        history_api = api.history()
        result = history_api.index()
        self.assertEqual(result["itemList"][0]["id"], song.id)

        # check if song has been removed from queue
        result = queue_api.index()
        self.assertEqual(len(result["itemList"]), 0)
Exemplo n.º 3
0
 def getNextSong(self):
     songs_api = api.songs()
     return songs_api.getNextSong()