Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-val
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-val
Commits
a22ee5a5
Commit
a22ee5a5
authored
Aug 28, 2014
by
Dave St.Germain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support youtube encoded videos by using a different Profile.
parent
42d1a0c2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
edxval/tests/constants.py
+12
-0
edxval/tests/test_views.py
+23
-0
No files found.
edxval/tests/constants.py
View file @
a22ee5a5
...
@@ -19,6 +19,12 @@ PROFILE_DICT_DESKTOP = dict(
...
@@ -19,6 +19,12 @@ PROFILE_DICT_DESKTOP = dict(
width
=
200
,
width
=
200
,
height
=
2001
height
=
2001
)
)
PROFILE_DICT_YOUTUBE
=
dict
(
profile_name
=
"youtube"
,
extension
=
"mp4"
,
width
=
1280
,
height
=
720
)
"""
"""
Encoded_videos for test_api, does not have profile.
Encoded_videos for test_api, does not have profile.
"""
"""
...
@@ -147,6 +153,12 @@ ENCODED_VIDEO_DICT_FISH_MOBILE = dict(
...
@@ -147,6 +153,12 @@ ENCODED_VIDEO_DICT_FISH_MOBILE = dict(
bitrate
=
42
,
bitrate
=
42
,
profile
=
"mobile"
,
profile
=
"mobile"
,
)
)
ENCODED_VIDEO_DICT_FISH_YOUTUBE
=
dict
(
url
=
"https://www.youtube.com/watch?v=OscRe3pSP80"
,
file_size
=
0
,
bitrate
=
42
,
profile
=
"youtube"
,
)
ENCODED_VIDEO_DICT_FISH_DESKTOP
=
dict
(
ENCODED_VIDEO_DICT_FISH_DESKTOP
=
dict
(
url
=
"https://www.swordsplints.com"
,
url
=
"https://www.swordsplints.com"
,
file_size
=
1234
,
file_size
=
1234
,
...
...
edxval/tests/test_views.py
View file @
a22ee5a5
...
@@ -399,6 +399,29 @@ class VideoListTest(APIAuthTestCase):
...
@@ -399,6 +399,29 @@ class VideoListTest(APIAuthTestCase):
videos
=
len
(
self
.
client
.
get
(
"/edxval/video/"
)
.
data
)
videos
=
len
(
self
.
client
.
get
(
"/edxval/video/"
)
.
data
)
self
.
assertEqual
(
videos
,
1
)
self
.
assertEqual
(
videos
,
1
)
def
test_post_with_youtube
(
self
):
"""
Test that youtube is a valid profile.
"""
url
=
reverse
(
'video-list'
)
Profile
.
objects
.
create
(
**
constants
.
PROFILE_DICT_YOUTUBE
)
video_data
=
dict
(
encoded_videos
=
[
constants
.
ENCODED_VIDEO_DICT_FISH_MOBILE
,
constants
.
ENCODED_VIDEO_DICT_FISH_YOUTUBE
],
**
constants
.
VIDEO_DICT_FISH
)
response
=
self
.
client
.
post
(
url
,
video_data
,
format
=
'json'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_201_CREATED
)
videos
=
self
.
client
.
get
(
"/edxval/video/"
)
.
data
self
.
assertEqual
(
len
(
videos
),
1
)
self
.
assertIn
(
'youtube.com'
,
videos
[
0
][
'encoded_videos'
][
1
][
'url'
])
def
test_complete_set_invalid_encoded_video_post
(
self
):
def
test_complete_set_invalid_encoded_video_post
(
self
):
"""
"""
Tests POSTing valid Video and partial valid EncodedVideos.
Tests POSTing valid Video and partial valid EncodedVideos.
...
...
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