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
19fe5457
Commit
19fe5457
authored
Apr 14, 2014
by
Valera Rozuvan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3318 from edx/valera/l62a
Update acceptance tests to use real duration of YouTube video.
parents
16a40883
615ce239
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
common/djangoapps/terrain/stubs/tests/test_youtube_stub.py
+5
-1
common/djangoapps/terrain/stubs/youtube.py
+6
-1
lms/djangoapps/courseware/features/video.feature
+4
-1
No files found.
common/djangoapps/terrain/stubs/tests/test_youtube_stub.py
View file @
19fe5457
...
...
@@ -24,7 +24,11 @@ class StubYouTubeServiceTest(unittest.TestCase):
self
.
url
+
'test_youtube/OEoXaMPEzfM?v=2&alt=jsonc&callback=callback_func'
)
self
.
assertEqual
(
'callback_func({"data": {"duration": 60, "message": "I
\'
m youtube.", "id": "OEoXaMPEzfM"}})'
,
response
.
content
)
# YouTube metadata for video `OEoXaMPEzfM` states that duration is 116.
self
.
assertEqual
(
'callback_func({"data": {"duration": 116, "message": "I
\'
m youtube.", "id": "OEoXaMPEzfM"}})'
,
response
.
content
)
def
test_transcript_url_equal
(
self
):
response
=
requests
.
get
(
...
...
common/djangoapps/terrain/stubs/youtube.py
View file @
19fe5457
...
...
@@ -98,11 +98,16 @@ class StubYouTubeHandler(StubHttpRequestHandler):
# Construct the response content
callback
=
self
.
get_params
[
'callback'
]
youtube_metadata
=
json
.
loads
(
requests
.
get
(
"http://gdata.youtube.com/feeds/api/videos/{id}?v=2&alt=jsonc"
.
format
(
id
=
youtube_id
)
)
.
text
)
data
=
OrderedDict
({
'data'
:
OrderedDict
({
'id'
:
youtube_id
,
'message'
:
message
,
'duration'
:
60
if
youtube_id
==
'OEoXaMPEzfM'
else
77
,
'duration'
:
youtube_metadata
[
'data'
][
'duration'
]
,
})
})
response
=
"{cb}({data})"
.
format
(
cb
=
callback
,
data
=
json
.
dumps
(
data
))
...
...
lms/djangoapps/courseware/features/video.feature
View file @
19fe5457
...
...
@@ -185,7 +185,10 @@ Feature: LMS.Video component
And
I select the
"1.50"
speed
And
I reload the page with video
Then
I see
"Hi, welcome to Edx."
text in the captions
And I see duration "1
:
00"
# The 1:56 time is the duration from metadata. 1:54 time is the duration reported
# by the video API once the video starts playing. The next step is correct because
# "1:56" is the duration in the VCR timer before the video plays.
And I see duration "1
:
56"
# 15
Scenario
:
Download button works correctly for non-english transcript in Youtube mode of Video component
...
...
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