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
55f0d0f9
Commit
55f0d0f9
authored
Jun 02, 2014
by
Muhammad Ammar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check YouTube for Bok-Choy
parent
fd18165b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
common/test/acceptance/tests/helpers.py
+33
-1
common/test/acceptance/tests/video/test_video_module.py
+4
-2
No files found.
common/test/acceptance/tests/helpers.py
View file @
55f0d0f9
"""
Test helper functions and base classes.
"""
import
requests
from
path
import
path
from
bok_choy.web_app_test
import
WebAppTest
from
bok_choy.promise
import
EmptyPromise
def
is_youtube_available
():
"""
Check if the required youtube urls are available.
If a URL in `youtube_api_urls` is not reachable then subsequent URLs will not be checked.
Returns:
bool:
"""
youtube_api_urls
=
{
'main'
:
'https://www.youtube.com/'
,
'player'
:
'http://www.youtube.com/iframe_api'
,
'metadata'
:
'http://gdata.youtube.com/feeds/api/videos/'
,
# 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=OEoXaMPEzfM'
,
}
for
url
in
youtube_api_urls
.
itervalues
():
try
:
response
=
requests
.
get
(
url
,
allow_redirects
=
False
)
except
requests
.
exceptions
.
ConnectionError
:
return
False
if
response
.
status_code
>=
300
:
return
False
return
True
def
load_data_str
(
rel_path
):
...
...
common/test/acceptance/tests/video/test_video_module.py
View file @
55f0d0f9
...
...
@@ -5,15 +5,16 @@ Acceptance tests for Video.
"""
import
json
from
unittest
import
skipIf
import
requests
from
..helpers
import
UniqueCourseTest
from
box.test.flaky
import
flaky
from
..helpers
import
UniqueCourseTest
,
is_youtube_available
from
...pages.lms.video.video
import
VideoPage
from
...pages.lms.tab_nav
import
TabNavPage
from
...pages.lms.course_nav
import
CourseNavPage
from
...pages.lms.auto_auth
import
AutoAuthPage
from
...pages.lms.course_info
import
CourseInfoPage
from
...fixtures.course
import
CourseFixture
,
XBlockFixtureDesc
from
box.test.flaky
import
flaky
VIDEO_SOURCE_PORT
=
8777
...
...
@@ -39,6 +40,7 @@ class YouTubeConfigError(Exception):
@flaky
@skipIf
(
is_youtube_available
()
is
False
,
'YouTube is not available!'
)
class
VideoBaseTest
(
UniqueCourseTest
):
"""
Base class for tests of the Video Player
...
...
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