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
7df13b8c
Commit
7df13b8c
authored
Aug 07, 2015
by
Bertrand Marron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update default video in tests
parent
52126907
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
40 additions
and
40 deletions
+40
-40
cms/djangoapps/contentstore/features/video.py
+1
-1
cms/djangoapps/contentstore/features/video_editor.py
+2
-2
common/lib/xmodule/xmodule/js/fixtures/video_html5.html
+1
-1
common/lib/xmodule/xmodule/tests/test_video.py
+1
-1
common/lib/xmodule/xmodule/video_module/video_module.py
+2
-2
common/test/acceptance/pages/studio/video/video.py
+2
-2
common/test/acceptance/tests/helpers.py
+1
-1
common/test/acceptance/tests/video/test_studio_video_editor.py
+3
-3
common/test/acceptance/tests/video/test_studio_video_module.py
+1
-1
common/test/acceptance/tests/video/test_studio_video_transcript.py
+1
-1
common/test/acceptance/tests/video/test_video_events.py
+1
-1
common/test/acceptance/tests/video/test_video_module.py
+17
-17
lms/djangoapps/courseware/features/video.feature
+2
-2
lms/djangoapps/courseware/tests/test_video_mongo.py
+5
-5
No files found.
cms/djangoapps/contentstore/features/video.py
View file @
7df13b8c
...
...
@@ -52,7 +52,7 @@ def i_created_a_video_component(step):
@step
(
'I have created a Video component with subtitles$'
)
def
i_created_a_video_with_subs
(
_step
):
_step
.
given
(
'I have created a Video component with subtitles "
3_yD_cEKoCk
"'
)
_step
.
given
(
'I have created a Video component with subtitles "
_Szu8hVDvgc
"'
)
@step
(
'I have created a Video component with subtitles "([^"]*)"$'
)
...
...
cms/djangoapps/contentstore/features/video_editor.py
View file @
7df13b8c
...
...
@@ -142,7 +142,7 @@ def correct_video_settings(_step):
expected_entries
=
[
# basic
[
DISPLAY_NAME
,
'Video'
,
False
],
[
'Default Video URL'
,
'http://youtu.be/
3_yD_cEKoCk
, , '
,
False
],
[
'Default Video URL'
,
'http://youtu.be/
_Szu8hVDvgc
, , '
,
False
],
# advanced
[
DISPLAY_NAME
,
'Video'
,
False
],
...
...
@@ -157,7 +157,7 @@ def correct_video_settings(_step):
[
'Video File URLs'
,
''
,
False
],
[
'Video Start Time'
,
'00:00:00'
,
False
],
[
'Video Stop Time'
,
'00:00:00'
,
False
],
[
'YouTube ID'
,
'
3_yD_cEKoCk
'
,
False
],
[
'YouTube ID'
,
'
_Szu8hVDvgc
'
,
False
],
[
'YouTube ID for .75x speed'
,
''
,
False
],
[
'YouTube ID for 1.25x speed'
,
''
,
False
],
[
'YouTube ID for 1.5x speed'
,
''
,
False
]
...
...
common/lib/xmodule/xmodule/js/fixtures/video_html5.html
View file @
7df13b8c
...
...
@@ -4,7 +4,7 @@
<div
id=
"video_id"
class=
"video closed"
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "ytMetadataUrl": "www.googleapis.com/youtube/v3/videos/", "source": "", "html5_sources": ["http://youtu.be/
3_yD_cEKoCk
.mp4"]}'
data-metadata=
'{"autohideHtml5": "true", "autoplay": "false", "captionDataDir": "", "endTime": "", "generalSpeed": "1.0", "saveStateUrl": "/save_user_state", "savedVideoPosition": "0", "showCaptions": "true", "sources": ["xmodule/include/fixtures/test.mp4","xmodule/include/fixtures/test.webm","xmodule/include/fixtures/test.ogv"], "speed": "1.5", "startTime": "", "streams": "", "sub": "Z5KLxerq05Y", "transcriptAvailableTranslationsUrl": "/transcript/available_translations", "transcriptLanguage": "en", "transcriptLanguages": {"en": "English", "de": "Deutsch", "zh": "普通话"}, "transcriptTranslationUrl": "/transcript/translation/__lang__", "ytApiUrl": "www.youtube.com/iframe_api", "ytImageUrl": "", "ytTestTimeout": "1500", "ytMetadataUrl": "www.googleapis.com/youtube/v3/videos/", "source": "", "html5_sources": ["http://youtu.be/
_Szu8hVDvgc
.mp4"]}'
>
<div
class=
"focus_grabber first"
></div>
...
...
common/lib/xmodule/xmodule/tests/test_video.py
View file @
7df13b8c
...
...
@@ -383,7 +383,7 @@ class VideoDescriptorImportTestCase(unittest.TestCase):
output
=
VideoDescriptor
.
from_xml
(
xml_data
,
module_system
,
Mock
())
self
.
assert_attributes_equal
(
output
,
{
'youtube_id_0_75'
:
''
,
'youtube_id_1_0'
:
'
3_yD_cEKoCk
'
,
'youtube_id_1_0'
:
'
_Szu8hVDvgc
'
,
'youtube_id_1_25'
:
''
,
'youtube_id_1_5'
:
''
,
'show_captions'
:
True
,
...
...
common/lib/xmodule/xmodule/video_module/video_module.py
View file @
7df13b8c
...
...
@@ -415,7 +415,7 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
one should compare own_metadata(self) and old_medatada.
Video player has two tabs, and due to nature of sync between tabs,
metadata from Basic tab is always sent when video player is edited and saved first time, for example:
{'youtube_id_1_0': u'
3_yD_cEKoCk', 'display_name': u'Video', 'sub': u'3_yD_cEKoCk
', 'html5_sources': []},
{'youtube_id_1_0': u'
_Szu8hVDvgc', 'display_name': u'Video', 'sub': u'_Szu8hVDvgc
', 'html5_sources': []},
that's why these fields will always present in old_metadata after first save. This should be fixed.
At consequent save requests html5_sources are always sent too, disregard of their change by user.
That means that html5_sources are always in list of fields that were changed (`metadata` param in save_item).
...
...
@@ -501,7 +501,7 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
youtube_string
=
create_youtube_string
(
self
)
# Mild workaround to ensure that tests pass -- if a field
# is set to its default value, we don't need to write it out.
if
youtube_string
and
youtube_string
!=
'1.00:
3_yD_cEKoCk
'
:
if
youtube_string
and
youtube_string
!=
'1.00:
_Szu8hVDvgc
'
:
xml
.
set
(
'youtube'
,
unicode
(
youtube_string
))
xml
.
set
(
'url_name'
,
self
.
url_name
)
attrs
=
{
...
...
common/test/acceptance/pages/studio/video/video.py
View file @
7df13b8c
...
...
@@ -53,7 +53,7 @@ DISPLAY_NAME = "Component Display Name"
DEFAULT_SETTINGS
=
[
# basic
[
DISPLAY_NAME
,
'Video'
,
False
],
[
'Default Video URL'
,
'http://youtu.be/
3_yD_cEKoCk
, , '
,
False
],
[
'Default Video URL'
,
'http://youtu.be/
_Szu8hVDvgc
, , '
,
False
],
# advanced
[
DISPLAY_NAME
,
'Video'
,
False
],
...
...
@@ -69,7 +69,7 @@ DEFAULT_SETTINGS = [
[
'Video ID'
,
''
,
False
],
[
'Video Start Time'
,
'00:00:00'
,
False
],
[
'Video Stop Time'
,
'00:00:00'
,
False
],
[
'YouTube ID'
,
'
3_yD_cEKoCk
'
,
False
],
[
'YouTube ID'
,
'
_Szu8hVDvgc
'
,
False
],
[
'YouTube ID for .75x speed'
,
''
,
False
],
[
'YouTube ID for 1.25x speed'
,
''
,
False
],
[
'YouTube ID for 1.5x speed'
,
''
,
False
]
...
...
common/test/acceptance/tests/helpers.py
View file @
7df13b8c
...
...
@@ -70,7 +70,7 @@ def is_youtube_available():
'player'
:
'https://www.youtube.com/iframe_api'
,
# For transcripts, you need to check an actual video, so we will
# just specify our default video and see if that one is available.
'transcript'
:
'http://video.google.com/timedtext?lang=en&v=
3_yD_cEKoCk
'
,
'transcript'
:
'http://video.google.com/timedtext?lang=en&v=
_Szu8hVDvgc
'
,
}
for
url
in
youtube_api_urls
.
itervalues
():
...
...
common/test/acceptance/tests/video/test_studio_video_editor.py
View file @
7df13b8c
...
...
@@ -25,7 +25,7 @@ class VideoEditorTest(CMSVideoBaseTest):
"""
if
subtitles
:
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
self
.
assets
.
append
(
'subs_
_Szu8hVDvgc
.srt.sjson'
)
self
.
navigate_to_course_unit
()
...
...
@@ -345,7 +345,7 @@ class VideoEditorTest(CMSVideoBaseTest):
And I open tab "Advanced"
And I click button "Add"
And I choose "uk" language code
And I try to upload transcript file "subs_
3_yD_cEKoCk
.srt.sjson"
And I try to upload transcript file "subs_
_Szu8hVDvgc
.srt.sjson"
Then I see validation error "Only SRT files can be uploaded. Please select a file ending in .srt to upload."
"""
self
.
_create_video_component
()
...
...
@@ -353,7 +353,7 @@ class VideoEditorTest(CMSVideoBaseTest):
self
.
open_advanced_tab
()
self
.
video
.
click_button
(
'translation_add'
)
self
.
video
.
select_translation_language
(
'uk'
)
self
.
video
.
upload_asset
(
'subs_
3_yD_cEKoCk
.srt.sjson'
,
asset_type
=
'transcript'
)
self
.
video
.
upload_asset
(
'subs_
_Szu8hVDvgc
.srt.sjson'
,
asset_type
=
'transcript'
)
error_msg
=
'Only SRT files can be uploaded. Please select a file ending in .srt to upload.'
self
.
assertEqual
(
self
.
video
.
upload_status_message
,
error_msg
)
...
...
common/test/acceptance/tests/video/test_studio_video_module.py
View file @
7df13b8c
...
...
@@ -150,7 +150,7 @@ class CMSVideoTest(CMSVideoBaseTest):
YouTubeStubConfig
.
configure
(
youtube_stub_config
)
if
subtitles
:
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
self
.
assets
.
append
(
'subs_
_Szu8hVDvgc
.srt.sjson'
)
self
.
navigate_to_course_unit
()
...
...
common/test/acceptance/tests/video/test_studio_video_transcript.py
View file @
7df13b8c
...
...
@@ -31,7 +31,7 @@ class VideoTranscriptTest(CMSVideoBaseTest):
def
setUp
(
self
):
super
(
VideoTranscriptTest
,
self
)
.
setUp
()
def
_create_video_component
(
self
,
subtitles
=
False
,
subtitle_id
=
'
3_yD_cEKoCk
'
):
def
_create_video_component
(
self
,
subtitles
=
False
,
subtitle_id
=
'
_Szu8hVDvgc
'
):
"""
Create a video component and navigate to unit page
...
...
common/test/acceptance/tests/video/test_video_events.py
View file @
7df13b8c
...
...
@@ -29,7 +29,7 @@ class VideoEventsTestMixin(EventsTestMixin, VideoBaseTest):
expected_event
=
{
'event'
:
{
'id'
:
video_locator
.
html_id
(),
'code'
:
'
3_yD_cEKoCk
'
'code'
:
'
_Szu8hVDvgc
'
}
}
self
.
assert_events_match
([
expected_event
],
[
video_event
])
...
...
common/test/acceptance/tests/video/test_video_module.py
View file @
7df13b8c
...
...
@@ -236,7 +236,7 @@ class YouTubeVideoTest(VideoBaseTest):
Then I see the correct english text in the captions
"""
self
.
_install_course_fixture
()
self
.
course_fixture
.
add_asset
([
'subs_
3_yD_cEKoCk
.srt.sjson'
])
self
.
course_fixture
.
add_asset
([
'subs_
_Szu8hVDvgc
.srt.sjson'
])
self
.
course_fixture
.
_upload_assets
()
self
.
_navigate_to_courseware_video_and_render
()
self
.
video
.
show_captions
()
...
...
@@ -298,8 +298,8 @@ class YouTubeVideoTest(VideoBaseTest):
And I see the correct non-english text in the captions
And the non-english transcript downloads correctly
"""
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
3_yD_cEKoCk
.srt.sjson'
])
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh'
:
'chinese_transcripts.srt'
},
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
_Szu8hVDvgc
.srt.sjson'
])
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh'
:
'chinese_transcripts.srt'
},
'sub'
:
'
_Szu8hVDvgc
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
...
...
@@ -332,8 +332,8 @@ class YouTubeVideoTest(VideoBaseTest):
Then the video with the transcript enabled is aligned correctly
And the video with the transcript hidden is aligned correctly
"""
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
data
=
{
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
assets
.
append
(
'subs_
_Szu8hVDvgc
.srt.sjson'
)
data
=
{
'sub'
:
'
_Szu8hVDvgc
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
...
...
@@ -416,9 +416,9 @@ class YouTubeVideoTest(VideoBaseTest):
And the Download Transcript menu does not exist for Video C
"""
data_a
=
{
'sub'
:
'
3_yD_cEKoCk
'
,
'download_track'
:
True
}
data_a
=
{
'sub'
:
'
_Szu8hVDvgc
'
,
'download_track'
:
True
}
youtube_a_metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data_a
)
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
self
.
assets
.
append
(
'subs_
_Szu8hVDvgc
.srt.sjson'
)
data_b
=
{
'youtube_id_1_0'
:
'b7xgknqkQk8'
,
'sub'
:
'b7xgknqkQk8'
,
'download_track'
:
True
}
youtube_b_metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data_b
)
...
...
@@ -476,8 +476,8 @@ class YouTubeVideoTest(VideoBaseTest):
And I select language with code "en"
Then I see "Welcome to edX." text in the captions
"""
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
3_yD_cEKoCk
.srt.sjson'
])
data
=
{
'transcripts'
:
{
"zh"
:
"chinese_transcripts.srt"
},
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
_Szu8hVDvgc
.srt.sjson'
])
data
=
{
'transcripts'
:
{
"zh"
:
"chinese_transcripts.srt"
},
'sub'
:
'
_Szu8hVDvgc
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
...
...
@@ -604,8 +604,8 @@ class YouTubeVideoTest(VideoBaseTest):
And I see duration "1:56"
"""
self
.
assets
.
extend
([
'subs_
3_yD_cEKoCk
.srt.sjson'
,
'subs_b7xgknqkQk8.srt.sjson'
])
data
=
{
'sub'
:
'
3_yD_cEKoCk
'
,
'youtube_id_1_5'
:
'b7xgknqkQk8'
}
self
.
assets
.
extend
([
'subs_
_Szu8hVDvgc
.srt.sjson'
,
'subs_b7xgknqkQk8.srt.sjson'
])
data
=
{
'sub'
:
'
_Szu8hVDvgc
'
,
'youtube_id_1_5'
:
'b7xgknqkQk8'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'youtube'
,
additional_data
=
data
)
# go to video
...
...
@@ -887,8 +887,8 @@ class Html5VideoTest(VideoBaseTest):
And I see the correct non-english text in the captions
And the non-english transcript downloads correctly
"""
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
3_yD_cEKoCk
.srt.sjson'
])
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh'
:
'chinese_transcripts.srt'
},
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
assets
.
extend
([
'chinese_transcripts.srt'
,
'subs_
_Szu8hVDvgc
.srt.sjson'
])
data
=
{
'download_track'
:
True
,
'transcripts'
:
{
'zh'
:
'chinese_transcripts.srt'
},
'sub'
:
'
_Szu8hVDvgc
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'html5'
,
additional_data
=
data
)
# go to video
...
...
@@ -922,8 +922,8 @@ class Html5VideoTest(VideoBaseTest):
And I view the video at fullscreen
Then the video with the transcript enabled is aligned correctly
"""
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
data
=
{
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
assets
.
append
(
'subs_
_Szu8hVDvgc
.srt.sjson'
)
data
=
{
'sub'
:
'
_Szu8hVDvgc
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'html5'
,
additional_data
=
data
)
# go to video
...
...
@@ -946,8 +946,8 @@ class Html5VideoTest(VideoBaseTest):
And I have uploaded an english transcript file to assets
Then I see the correct text in the captions
"""
self
.
assets
.
append
(
'subs_
3_yD_cEKoCk
.srt.sjson'
)
data
=
{
'sub'
:
'
3_yD_cEKoCk
'
}
self
.
assets
.
append
(
'subs_
_Szu8hVDvgc
.srt.sjson'
)
data
=
{
'sub'
:
'
_Szu8hVDvgc
'
}
self
.
metadata
=
self
.
metadata_for_mode
(
'html5'
,
additional_data
=
data
)
# go to video
...
...
lms/djangoapps/courseware/features/video.feature
View file @
7df13b8c
...
...
@@ -6,12 +6,12 @@ Feature: LMS.Video component
Scenario
:
Verify that each video in sub-section includes a transcript for Youtube and non-Youtube countries
Given
youtube server is up and response time is 2 seconds
And
I am registered for the course
"test_course"
And
I have a
"subs_
3_yD_cEKoCk
.srt.sjson"
transcript file in assets
And
I have a
"subs_
_Szu8hVDvgc
.srt.sjson"
transcript file in assets
And
I have a
"subs_b7xgknqkQk8.srt.sjson"
transcript file in assets
And
I have a
"chinese_transcripts.srt"
transcript file in assets
And it has videos "A, B" in "Youtube_HTML5" mode in position "1" of sequential
:
|
sub
|
|
3_yD_cEKoCk
|
|
_Szu8hVDvgc
|
|
b7xgknqkQk8
|
And a video "C" in "Youtube_HTML5" mode in position "2" of sequential
:
|
transcripts
|
...
...
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
7df13b8c
...
...
@@ -127,7 +127,7 @@ class TestVideoNonYouTube(TestVideo):
'metadata'
:
json
.
dumps
(
OrderedDict
({
"saveStateUrl"
:
self
.
item_descriptor
.
xmodule_runtime
.
ajax_url
+
"/save_user_state"
,
"autoplay"
:
False
,
"streams"
:
"1.00:
3_yD_cEKoCk
"
,
"streams"
:
"1.00:
_Szu8hVDvgc
"
,
"sub"
:
"a_sub_file.srt.sjson"
,
"sources"
:
sources
,
"captionDataDir"
:
None
,
...
...
@@ -181,7 +181,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
self
.
default_metadata_dict
=
OrderedDict
({
"saveStateUrl"
:
""
,
"autoplay"
:
settings
.
FEATURES
.
get
(
'AUTOPLAY_VIDEOS'
,
True
),
"streams"
:
"1.00:
3_yD_cEKoCk
"
,
"streams"
:
"1.00:
_Szu8hVDvgc
"
,
"sub"
:
"a_sub_file.srt.sjson"
,
"sources"
:
'[]'
,
"captionDataDir"
:
None
,
...
...
@@ -811,7 +811,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
def
test_source_not_in_html5sources
(
self
):
metadata
=
{
'source'
:
'http://example.org/video.mp4'
,
'html5_sources'
:
[
'http://youtu.be/
3_yD_cEKoCk
.mp4'
],
'html5_sources'
:
[
'http://youtu.be/
_Szu8hVDvgc
.mp4'
],
}
self
.
initialize_module
(
metadata
=
metadata
)
...
...
@@ -839,7 +839,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
metadata
=
{
'track'
:
u'http://some_track.srt'
,
'source'
:
'http://example.org/video.mp4'
,
'html5_sources'
:
[
'http://youtu.be/
3_yD_cEKoCk
.mp4'
],
'html5_sources'
:
[
'http://youtu.be/
_Szu8hVDvgc
.mp4'
],
'download_video'
:
False
,
}
...
...
@@ -856,7 +856,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
def
test_source_is_empty
(
self
):
metadata
=
{
'source'
:
''
,
'html5_sources'
:
[
'http://youtu.be/
3_yD_cEKoCk
.mp4'
],
'html5_sources'
:
[
'http://youtu.be/
_Szu8hVDvgc
.mp4'
],
}
self
.
initialize_module
(
metadata
=
metadata
)
...
...
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