예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
    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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #22
0
 def test_get_home(self):
     client = Client()
     categories = client.get_home()
     self.assertGreaterEqual(len(categories), 0)
     pass
 def test_get_follower(self):
     client = Client()
     json_data = client.get_follower(520685)
     pass
예제 #24
0
    def test_get_format_content(self):
        client = Client()

        result = client.get_format_content('pro7', 'pro7:789')
        pass
 def test_get_categories(self):
     client = Client()
     result = client.get_categories()
     pass
 def test_get_recommended_for_track(self):
     client = Client()
     json_data = client.get_recommended_for_track(193347852, page=1)
     pass
 def test_get_track_url(self):
     client = Client()
     url = client.get_track_url(193347852)
     pass
 def test_get_track(self):
     client = Client()
     json_data = client.get_track(193347852)
     pass
 def test_get_likes(self):
     client = Client()
     json_data = client.get_likes(520685)
     pass
예제 #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
예제 #31
0
 def test_search(self):
     client = Client()
     result = client.search('halligalli')
     pass
 def test_tracks(self):
     client = Client()
     json_data = client.get_tracks(1701116)
     pass
예제 #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
 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
 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
 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
예제 #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
예제 #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
 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
예제 #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
예제 #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
예제 #50
0
 def test_get_home(self):
     client = Client()
     categories = client.get_home()
     self.assertGreaterEqual(len(categories), 0)
     pass
 def test_user(self):
     client = Client()
     json_data = client.get_user(1701116)
     pass
예제 #52
0
 def test_get_feed(self):
     client = Client()
     feed = client.get_feed(40)
     pass
 def test_get_genre(self):
     client = Client()
     result = client.get_genre('techno')
     pass
예제 #54
0
 def setUp(self):
     self._client = Client()
     access_data = self._client.authenticate()
     self._client = Client(access_data['access_token'])
     pass
예제 #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