示例#1
0
    def setUp(self):

        self.playerInfo = PlayerInfo()
        self.playerInfo.set_provider('yly', 'http://uri-logo.com')
        self.playerInfo.set_provider_name('yyy-second')

        self.playerInfo.set_lyric('http://uri-lrc.com')
        self.playerInfo.set_art('art')
        self.playerInfo.set_title('title')
        self.playerInfo.set_title_subtext1('sub text1')
        self.playerInfo.set_title_subtext2('sub text2')
        self.playerInfo.set_audio_item_type(PlayerInfoAudioItemEnum.FORMAT_LRC)
        self.playerInfo.set_media_length_in_ms(12321.232)

        favoriteButton = FavoriteButton()
        favoriteButton.set_enabled(False)
        self.playerInfo.add_control(favoriteButton)

        showPlayListButton = ShowPlayListButton()
        showPlayListButton.set_selected(True)
        self.playerInfo.set_controls(showPlayListButton)

        showFavoriteListButton = ShowFavoriteListButton()
        repeatButton = RepeatButton(RepeatButtonEnum.REPEAT_ONE)
        self.playerInfo.set_controls([showFavoriteListButton, repeatButton])
示例#2
0
class ShowFavoriteListButtonTest(unittest.TestCase):

    def setUp(self):
        self.showFavoriteListButton = ShowFavoriteListButton()
        self.showFavoriteListButton.set_enabled(False)
        self.showFavoriteListButton.set_selected(True)

    def testGetData(self):

        ret = {
            'type': 'BUTTON',
            'name': 'SHOW_FAVORITE_LIST',
            'enabled': False,
            'selected': True

        }

        self.assertEqual(self.showFavoriteListButton.get_data(), ret)
    pass
示例#3
0
 def setUp(self):
     self.showFavoriteListButton = ShowFavoriteListButton()
     self.showFavoriteListButton.set_enabled(False)
     self.showFavoriteListButton.set_selected(True)