Ejemplo n.º 1
0
    def test_get_home_page(self):
        client = Client()

        for channel_id in Client.CHANNEL_ID_LIST:
            result = client.get_homepage(channel_id)
            pass
        pass
Ejemplo n.º 2
0
    def test_get_home_page(self):
        client = Client()

        for channel_id in Client.CHANNEL_ID_LIST:
            result = client.get_homepage(channel_id)
            pass
        pass
Ejemplo n.º 3
0
    def test_get_channel_formats(self):
        client = Client()

        for channel_id in Client.CHANNEL_ID_LIST:
            result = client.get_formats(channel_id)
            pass

        pass
Ejemplo n.º 4
0
    def test_get_channel_formats(self):
        client = Client()

        for channel_id in Client.CHANNEL_ID_LIST:
            result = client.get_formats(channel_id)
            pass

        pass
Ejemplo n.º 5
0
    def test_follow(self):
        login_data = Client().login(username=self.USERNAME, password=self.PASSWORD)
        client = Client(access_token=login_data['access_token'])
        json_data = client.follow_user(1647796, False)
        self.assertGreater(len(json_data), 0)

        json_data = client.follow_user(1647796, True)
        self.assertGreater(len(json_data), 0)
        pass
Ejemplo n.º 6
0
    def test_get_video_streams(self):
        format_ids = ['pro7:277', 'pro7:505']

        client = Client()
        json_data = client.get_new_videos(format_ids)
        item = json_data['items'][0]

        video_data = client.get_video_url(item['id'])
        pass
Ejemplo n.º 7
0
    def test_calculate_request_signature(self):
        client = Client()

        sig = client.calculate_request_signature(time_stamp=1414434266907)
        self.assertEqual('7782bff6e9d3602c90379ee595fbc4620ba2dd2b', sig)

        sig = client.calculate_request_signature(time_stamp=1414434267559)
        self.assertEqual('88807861fe02b508b0604f578a56ecfeabb3be79', sig)
        pass
Ejemplo n.º 8
0
    def test_get_video_streams(self):
        format_ids = ['pro7:277', 'pro7:505']

        client = Client()
        json_data = client.get_new_videos(format_ids)
        item = json_data['items'][0]

        video_data = client.get_video_url(item['id'])
        pass
    def test_resolve_url(self):
        client = Client()

        url = 'http://soundcloud.com/qdance/luna-presents-minus-is-more-december-2014-yearmix'
        json_data = client.resolve_url(url)

        url = 'http://soundcloud.com/julyukie/sets/juliana-yamasaki-new-tracks'
        json_data = client.resolve_url(url)
        pass
Ejemplo n.º 10
0
    def test_resolve_url(self):
        client = Client()

        url = 'http://soundcloud.com/qdance/luna-presents-minus-is-more-december-2014-yearmix'
        json_data = client.resolve_url(url)

        url = 'http://soundcloud.com/julyukie/sets/juliana-yamasaki-new-tracks'
        json_data = client.resolve_url(url)
        pass
    def test_login(self):
        login_data = Client().login(username=self.USERNAME,
                                    password=self.PASSWORD)

        self.assertRaises(nightcrawler.CredentialsException,
                          Client().login,
                          username=self.USERNAME,
                          password='******')
        pass
Ejemplo n.º 12
0
    def test_get_format_video(self):
        client = Client()

        result = client.get_format_videos('pro7', 'pro7:505', page=2)
        objects = result.get('objects', [])
        self.assertGreater(len(objects), 0)

        for video in objects:
            print video['title']
            pass
        pass
Ejemplo n.º 13
0
    def test_get_format_video(self):
        client = Client()

        result = client.get_format_videos('pro7', 'pro7:505', page=2)
        objects = result.get('objects', [])
        self.assertGreater(len(objects), 0)

        for video in objects:
            print video['title']
            pass
        pass
Ejemplo n.º 14
0
    def test_play(self):
        provider = Provider()

        client = Client()
        videos = client.get_feed(40)
        video_id = videos[1]['id']
        context = nightcrawler.Context(path='/play/',
                                       params={'video_id': video_id})
        settings = context.get_settings()
        settings.set_int(settings.VIDEO_QUALITY, 4)
        result = provider.navigate(context)
        pass
Ejemplo n.º 15
0
class TestClient(unittest.TestCase):
    def setUp(self):
        self._client = Client()
        access_data = self._client.authenticate()
        self._client = Client(access_data['access_token'])
        pass

    def test_get_posts(self):
        video_data = self._client.get_posts('LJEGX')
        next_reference_key = video_data.get('next_reference_key', '')
        while next_reference_key:
            video_data = self._client.get_posts('LJEGX', next_reference_key=next_reference_key)
            next_reference_key = video_data.get('next_reference_key', '')
            pass
        pass

    def test_get_available(self):
        client = self._client
        categories = client.get_available()
        for category in categories:
            video_data = self._client.get_posts(category['id'])
            self.assertGreater(len(video_data['items']), 0)
            pass
        pass

    def test_authenticate(self):
        client = Client()

        access_token, expires = client.authenticate()
        pass

    def test_calculate_request_signature(self):
        client = Client()

        sig = client.calculate_request_signature(time_stamp=1414434266907)
        self.assertEqual('7782bff6e9d3602c90379ee595fbc4620ba2dd2b', sig)

        sig = client.calculate_request_signature(time_stamp=1414434267559)
        self.assertEqual('88807861fe02b508b0604f578a56ecfeabb3be79', sig)
        pass

    pass
 def test_get_track(self):
     client = Client()
     json_data = client.get_track(193347852)
     pass
 def test_user(self):
     client = Client()
     json_data = client.get_user(1701116)
     pass
 def test_get_follower(self):
     client = Client()
     json_data = client.get_follower(520685)
     pass
 def test_get_playlists(self):
     client = Client()
     json_data = client.get_playlists(520685)
     pass
 def test_search(self):
     client = Client()
     tracks = client.search('angerfist', category='sounds')
     pass
 def test_get_categories(self):
     client = Client()
     result = client.get_categories()
     pass
Ejemplo n.º 22
0
 def test_get_home(self):
     client = Client()
     categories = client.get_home()
     self.assertGreaterEqual(len(categories), 0)
     pass
Ejemplo n.º 23
0
 def test_get_follower(self):
     client = Client()
     json_data = client.get_follower(520685)
     pass
Ejemplo n.º 24
0
    def test_get_format_content(self):
        client = Client()

        result = client.get_format_content('pro7', 'pro7:789')
        pass
Ejemplo n.º 25
0
 def test_get_categories(self):
     client = Client()
     result = client.get_categories()
     pass
Ejemplo n.º 26
0
 def test_get_recommended_for_track(self):
     client = Client()
     json_data = client.get_recommended_for_track(193347852, page=1)
     pass
Ejemplo n.º 27
0
 def test_get_track_url(self):
     client = Client()
     url = client.get_track_url(193347852)
     pass
Ejemplo n.º 28
0
 def test_get_track(self):
     client = Client()
     json_data = client.get_track(193347852)
     pass
Ejemplo n.º 29
0
 def test_get_likes(self):
     client = Client()
     json_data = client.get_likes(520685)
     pass
Ejemplo n.º 30
0
 def test_get_video_streams(self):
     client = Client()
     videos = client.get_feed(40)
     video_id = videos[0]['id']
     json_data = client.get_video_streams(video_id)
     pass
Ejemplo n.º 31
0
 def test_search(self):
     client = Client()
     result = client.search('halligalli')
     pass
Ejemplo n.º 32
0
 def test_tracks(self):
     client = Client()
     json_data = client.get_tracks(1701116)
     pass
Ejemplo n.º 33
0
    def test_get_new_video(self):
        format_ids = ['pro7:277', 'pro7:505']

        client = Client()
        json_data = client.get_new_videos(format_ids)
        pass
 def test_get_genre(self):
     client = Client()
     result = client.get_genre('techno')
     pass
Ejemplo n.º 35
0
 def test_get_playlist(self):
     client = Client()
     json_data = client.get_playlist(55019726)
     self.assertGreater(len(json_data), 0)
     pass
 def test_get_likes(self):
     client = Client()
     json_data = client.get_likes(520685)
     pass
Ejemplo n.º 37
0
 def test_get_trending(self):
     client = Client()
     result = client.get_trending('audio')
     pass
 def test_get_playlist(self):
     client = Client()
     json_data = client.get_playlist(55019726)
     self.assertGreater(len(json_data), 0)
     pass
Ejemplo n.º 39
0
 def test_get_playlists(self):
     client = Client()
     json_data = client.get_playlists(520685)
     pass
 def test_get_recommended_for_track(self):
     client = Client()
     json_data = client.get_recommended_for_track(193347852, page=1)
     pass
Ejemplo n.º 41
0
 def test_search(self):
     client = Client()
     xml = client.search('superman')
     pass
 def test_tracks(self):
     client = Client()
     json_data = client.get_tracks(1701116)
     pass
Ejemplo n.º 43
0
    def test_authenticate(self):
        client = Client()

        access_token, expires = client.authenticate()
        pass
 def test_get_track_url(self):
     client = Client()
     url = client.get_track_url(193347852)
     pass
Ejemplo n.º 45
0
 def test_search(self):
     client = Client()
     tracks = client.search('angerfist', category='sounds')
     playlist = client.search('angerfist', category='sets')
     people = client.search('angerfist', category='people')
     pass
Ejemplo n.º 46
0
 def test_get_feed(self):
     client = Client()
     feed = client.get_feed(40)
     pass
 def test_get_stream(self):
     login_data = Client().login(username=self.USERNAME,
                                 password=self.PASSWORD)
     client = Client(access_token=login_data['access_token'])
     json_data = client.get_stream()
     pass
Ejemplo n.º 48
0
 def test_search(self):
     client = Client()
     xml = client.search('superman')
     pass
 def test_get_trending(self):
     client = Client()
     result = client.get_trending('audio')
     pass
Ejemplo n.º 50
0
 def test_get_home(self):
     client = Client()
     categories = client.get_home()
     self.assertGreaterEqual(len(categories), 0)
     pass
Ejemplo n.º 51
0
 def test_user(self):
     client = Client()
     json_data = client.get_user(1701116)
     pass
Ejemplo n.º 52
0
 def test_get_feed(self):
     client = Client()
     feed = client.get_feed(40)
     pass
Ejemplo n.º 53
0
 def test_get_genre(self):
     client = Client()
     result = client.get_genre('techno')
     pass
Ejemplo n.º 54
0
 def setUp(self):
     self._client = Client()
     access_data = self._client.authenticate()
     self._client = Client(access_data['access_token'])
     pass
Ejemplo n.º 55
0
 def test_get_video_streams(self):
     client = Client()
     videos = client.get_feed(40)
     video_id = videos[0]['id']
     json_data = client.get_video_streams(video_id)
     pass