Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ea56a0cd
Commit
ea56a0cd
authored
Jun 20, 2013
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure we can handle empty youtube attributes.
parent
c77eb4fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
common/lib/xmodule/xmodule/tests/test_video_xml.py
+11
-0
common/lib/xmodule/xmodule/video_module.py
+2
-0
No files found.
common/lib/xmodule/xmodule/tests/test_video_xml.py
View file @
ea56a0cd
...
...
@@ -110,3 +110,14 @@ class VideoModuleLogicTest(LogicTest):
youtube_str
=
'1.00:p2Q6BrNhdh8'
youtube_str_hack
=
'1.0:p2Q6BrNhdh8'
self
.
assertEqual
(
_parse_youtube
(
youtube_str
),
_parse_youtube
(
youtube_str_hack
))
def
test_parse_youtube_empty
(
self
):
"""
Some courses have empty youtube attributes, so we should handle
that well.
"""
self
.
assertEqual
(
_parse_youtube
(
''
),
{
'0.75'
:
''
,
'1.00'
:
''
,
'1.25'
:
''
,
'1.50'
:
''
})
common/lib/xmodule/xmodule/video_module.py
View file @
ea56a0cd
...
...
@@ -168,6 +168,8 @@ def _parse_youtube(data):
XML-based courses.
"""
ret
=
{
'0.75'
:
''
,
'1.00'
:
''
,
'1.25'
:
''
,
'1.50'
:
''
}
if
data
==
''
:
return
ret
videos
=
data
.
split
(
','
)
for
video
in
videos
:
pieces
=
video
.
split
(
':'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment