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
ae6f97a3
Commit
ae6f97a3
authored
Aug 16, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for test_static_url_generation_from_courseid
parent
bca2018a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
common/lib/xmodule/xmodule/tests/test_content.py
+6
-0
No files found.
common/lib/xmodule/xmodule/tests/test_content.py
View file @
ae6f97a3
...
...
@@ -19,12 +19,18 @@ class ContentTest(unittest.TestCase):
content
=
StaticContent
(
'loc'
,
'name'
,
'content_type'
,
'data'
)
self
.
assertIsNone
(
content
.
thumbnail_location
)
def
test_static_url_generation_from_courseid
(
self
):
url
=
StaticContent
.
convert_legacy_static_url_with_course_id
(
'images_course_image.jpg'
,
'foo/bar/bz'
)
self
.
assertEqual
(
url
,
'/c4x/foo/bar/asset/images_course_image.jpg'
)
def
test_generate_thumbnail_image
(
self
):
contentStore
=
ContentStore
()
content
=
Content
(
Location
(
u'c4x'
,
u'mitX'
,
u'800'
,
u'asset'
,
u'monsters__.jpg'
),
None
)
(
thumbnail_content
,
thumbnail_file_location
)
=
contentStore
.
generate_thumbnail
(
content
)
self
.
assertIsNone
(
thumbnail_content
)
self
.
assertEqual
(
Location
(
u'c4x'
,
u'mitX'
,
u'800'
,
u'thumbnail'
,
u'monsters__.jpg'
),
thumbnail_file_location
)
def
test_compute_location
(
self
):
# We had a bug that __ got converted into a single _. Make sure that substitution of INVALID_CHARS (like space)
# still happen.
...
...
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