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
83b0eda4
Commit
83b0eda4
authored
Feb 07, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for ignoring tilde static files on import
parent
cc091f83
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
common/lib/xmodule/xmodule/tests/test_import_static.py
+20
-0
common/test/data/tilde/static/example.txt
+1
-0
common/test/data/tilde/static/example.txt~
+1
-0
No files found.
common/lib/xmodule/xmodule/tests/test_import_static.py
0 → 100644
View file @
83b0eda4
import
unittest
from
path
import
path
from
mock
import
Mock
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.xml_importer
import
import_static_content
from
xmodule.tests
import
DATA_DIR
class
IgnoredFilesTestCase
(
unittest
.
TestCase
):
def
test_ignore_tilde_static_files
(
self
):
course_dir
=
DATA_DIR
/
"tilde"
loc
=
Location
(
"edX"
,
"tilde"
,
"Fall_2012"
)
content_store
=
Mock
()
content_store
.
generate_thumbnail
.
return_value
=
(
"content"
,
"location"
)
import_static_content
(
Mock
(),
Mock
(),
course_dir
,
content_store
,
loc
)
saved_static_content
=
[
call
[
0
][
0
]
for
call
in
content_store
.
save
.
call_args_list
]
name_val
=
{
sc
.
name
:
sc
.
data
for
sc
in
saved_static_content
}
self
.
assertIn
(
"example.txt"
,
name_val
)
self
.
assertNotIn
(
"example.txt~"
,
name_val
)
self
.
assertIn
(
"GREEN"
,
name_val
[
"example.txt"
])
common/test/data/tilde/static/example.txt
0 → 100644
View file @
83b0eda4
GREEN
common/test/data/tilde/static/example.txt~
0 → 100644
View file @
83b0eda4
RED
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