Commit ba00a5f2 by Christopher Lee

Merge pull request #35 from edx/clee/get_url_for_profile_bug

fixed get_url_for_profile
parents 8778a639 7a6d5fc9
...@@ -220,12 +220,10 @@ def get_url_for_profile(edx_video_id, profile): ...@@ -220,12 +220,10 @@ def get_url_for_profile(edx_video_id, profile):
profile (str): a string of the profile we are searching profile (str): a string of the profile we are searching
Returns: Returns:
A dict containing the profile to url. The return type is the same as A string with the url
get_urls_for_profiles for consistency.
""" """
url = get_urls_for_profiles(edx_video_id, [profile])[profile] return get_urls_for_profiles(edx_video_id, [profile])[profile]
return {profile: url}
def get_videos_for_course(course_id): def get_videos_for_course(course_id):
......
...@@ -265,9 +265,8 @@ class GetUrlsForProfileTest(TestCase): ...@@ -265,9 +265,8 @@ class GetUrlsForProfileTest(TestCase):
""" """
profile = "mobile" profile = "mobile"
edx_video_id = constants.VIDEO_DICT_FISH['edx_video_id'] edx_video_id = constants.VIDEO_DICT_FISH['edx_video_id']
urls = api.get_url_for_profile(edx_video_id, profile) url = api.get_url_for_profile(edx_video_id, profile)
self.assertEqual(len(urls), 1) self.assertEqual(url, u'http://www.meowmix.com')
self.assertEqual(urls["mobile"], u'http://www.meowmix.com')
class GetVideosForIds(TestCase): class GetVideosForIds(TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment