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
f4fe6de3
Commit
f4fe6de3
authored
Aug 15, 2013
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #684 from rocha/test-invalid-youtube-ids
Add test for invalid YouTube IDs strings
parents
c9e0d36d
9199f1d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
common/lib/xmodule/xmodule/tests/test_video.py
+26
-0
No files found.
common/lib/xmodule/xmodule/tests/test_video.py
View file @
f4fe6de3
...
...
@@ -64,6 +64,32 @@ class VideoModuleTest(LogicTest):
'1.25'
:
''
,
'1.50'
:
''
})
def
test_parse_youtube_invalid
(
self
):
"""Ensure that ids that are invalid return an empty dict"""
# invalid id
youtube_str
=
'thisisaninvalidid'
output
=
VideoDescriptor
.
_parse_youtube
(
youtube_str
)
self
.
assertEqual
(
output
,
{
'0.75'
:
''
,
'1.00'
:
''
,
'1.25'
:
''
,
'1.50'
:
''
})
# another invalid id
youtube_str
=
',::,:,,'
output
=
VideoDescriptor
.
_parse_youtube
(
youtube_str
)
self
.
assertEqual
(
output
,
{
'0.75'
:
''
,
'1.00'
:
''
,
'1.25'
:
''
,
'1.50'
:
''
})
# and another one, partially invalid
youtube_str
=
'0.75_BAD!!!,1.0:AXdE34_U,1.25:KLHF9K_Y,1.5:VO3SxfeD,'
output
=
VideoDescriptor
.
_parse_youtube
(
youtube_str
)
self
.
assertEqual
(
output
,
{
'0.75'
:
''
,
'1.00'
:
'AXdE34_U'
,
'1.25'
:
'KLHF9K_Y'
,
'1.50'
:
'VO3SxfeD'
})
def
test_parse_youtube_key_format
(
self
):
"""
Make sure that inconsistent speed keys are parsed correctly.
...
...
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