def test_root(self):
        provider = Provider()
        context = kodion.Context('/')
        settings = context.get_settings()
        settings.set_string(kodion.constants.setting.LOGIN_USERNAME, '')

        # without login
        result = provider.navigate(context)
        items = result[0]
        self.assertEqual(2, len(items))
        print_items(items)

        # with login
        context = kodion.Context('/')
        settings = context.get_settings()
        settings.set_string(kodion.constants.setting.LOGIN_USERNAME,
                            '*****@*****.**')
        settings.set_string(kodion.constants.setting.LOGIN_PASSWORD,
                            '1234567890')

        result = provider.navigate(context)
        items = result[0]
        self.assertEqual(4, len(items))

        print_items(items)
        pass
Exemple #2
0
    def test_search(self):
        provider = Provider()

        path = '/%s/query/' % kodion.constants.paths.SEARCH
        context = kodion.Context(path=path, params={'q': 'angerfist'})
        result = provider.navigate(context)
        pass
Exemple #3
0
 def test_get_favorites(self):
     provider = Provider()
     context = self._create_context('/user/favorites/me/')
     result = provider.navigate(context)
     items = result[0]
     print_items(items)
     pass
    def test_search(self):
        provider = Provider()

        path = '/%s/query/' % kodion.constants.paths.SEARCH
        context = kodion.Context(path=path, params={'q': 'angerfist'})
        context.set_localization(30516, 'TEST %s')
        result = provider.navigate(context)
        pass
 def test_get_favorites(self):
     provider = Provider()
     context = self._create_context('/user/favorites/me/')
     context.set_localization(30516, 'TEST %s')
     result = provider.navigate(context)
     items = result[0]
     print_items(items)
     pass
    def test_get_user_playlists(self):
        provider = Provider()

        context = self._create_context('/user/playlists/me/')
        result = provider.navigate(context)
        items = result[0]
        print_items(items)
        pass
Exemple #7
0
    def test_get_playlist(self):
        provider = Provider()

        context = self._create_context('/playlist/54934787/')
        result = provider.navigate(context)
        items = result[0]
        print_items(items)
        pass
    def test_get_following(self):
        provider = Provider()

        context = self._create_context('/user/following/me/')
        result = provider.navigate(context)
        items = result[0]
        print_items(items)
        pass
 def test_get_recommended_for_track(self):
     provider = Provider()
     context = self._create_context('/explore/recommended/tracks/193347852/')
     context.set_localization(30516, 'TEST %s')
     result = provider.navigate(context)
     items = result[0]
     print_items(items)
     pass
 def test_get_favorites(self):
     provider = Provider()
     context = self._create_context('/user/favorites/me/')
     context.set_localization(30516, 'TEST %s')
     result = provider.navigate(context)
     items = result[0]
     print_items(items)
     pass
 def test_get_recommended_for_track(self):
     provider = Provider()
     context = self._create_context(
         '/explore/recommended/tracks/193347852/')
     context.set_localization(30516, 'TEST %s')
     result = provider.navigate(context)
     items = result[0]
     print_items(items)
     pass
    def test_get_playlist(self):
        provider = Provider()

        context = self._create_context('/playlist/54934787/')
        context.set_localization(30516, 'TEST %s')
        result = provider.navigate(context)
        items = result[0]
        print_items(items)
        pass
    def test_get_playlist(self):
        provider = Provider()

        context = self._create_context('/playlist/54934787/')
        context.set_localization(30516, 'TEST %s')
        result = provider.navigate(context)
        items = result[0]
        print_items(items)
        pass
    def test_explore_genres(self):
        provider = Provider()

        # music
        context = self._create_context('/explore/genre/music/')
        context.get_function_cache().disable()
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)

        # audio
        context = self._create_context('/explore/genre/audio/')
        context.get_function_cache().disable()
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)
        pass
    def test_explore(self):
        provider = Provider()

        context = kodion.Context(path='/explore/')
        result = provider.navigate(context)
        items = result[0]

        self.assertEqual(4, len(items))
        print_items(items)
        pass
    def test_explore_genres(self):
        provider = Provider()

        # music
        context = self._create_context('/explore/genre/music/')
        context.get_function_cache().disable()
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)

        # audio
        context = self._create_context('/explore/genre/audio/')
        context.get_function_cache().disable()
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)
        pass
    def test_explore(self):
        provider = Provider()

        context = kodion.Context(path='/explore/')
        result = provider.navigate(context)
        items = result[0]

        self.assertEqual(4, len(items))
        print_items(items)
        pass
    def test_explore_trending(self):
        provider = Provider()

        # music
        context = self._create_context('/explore/trending/music/')
        context.set_localization(30516, 'TEST %s')
        context.get_function_cache().disable()
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)

        # audio
        context = self._create_context('/explore/trending/audio/')
        context.set_localization(30516, 'TEST %s')
        context.get_function_cache().disable()
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)
        pass
    def test_explore_trending(self):
        provider = Provider()

        # music
        context = self._create_context('/explore/trending/music/')
        context.set_localization(30516, 'TEST %s')
        context.get_function_cache().disable()
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)

        # audio
        context = self._create_context('/explore/trending/audio/')
        context.set_localization(30516, 'TEST %s')
        context.get_function_cache().disable()
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)
        pass
    def test_explore_genres_drum_bass(self):
        provider = Provider()

        context = self._create_context('/explore/genre/music/Drum & Bass/')
        context.set_localization(30516, 'TEST %s')
        context.get_function_cache().disable()

        # music
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)
        pass
    def test_explore_genres_drum_bass(self):
        provider = Provider()

        context = self._create_context('/explore/genre/music/Drum & Bass/')
        context.set_localization(30516, 'TEST %s')
        context.get_function_cache().disable()

        # music
        result = provider.navigate(context)
        items = result[0]
        self.assertGreater(len(items), 0)
        print_items(items)
        pass
    def test_root(self):
        provider = Provider()
        context = kodion.Context('/')
        settings = context.get_settings()
        settings.set_string(kodion.constants.setting.LOGIN_USERNAME, '')

        # without login
        result = provider.navigate(context)
        items = result[0]
        self.assertEqual(2, len(items))
        print_items(items)

        # with login
        context = kodion.Context('/')
        settings = context.get_settings()
        settings.set_string(kodion.constants.setting.LOGIN_USERNAME, '*****@*****.**')
        settings.set_string(kodion.constants.setting.LOGIN_PASSWORD, '1234567890')

        result = provider.navigate(context)
        items = result[0]
        self.assertEqual(4, len(items))

        print_items(items)
        pass