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
b53c419b
Commit
b53c419b
authored
Jul 06, 2016
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests.
parent
3a647662
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
7 deletions
+46
-7
pavelib/paver_tests/test_assets.py
+46
-7
No files found.
pavelib/paver_tests/test_assets.py
View file @
b53c419b
...
@@ -204,13 +204,52 @@ class TestPaverWatchAssetTasks(TestCase):
...
@@ -204,13 +204,52 @@ class TestPaverWatchAssetTasks(TestCase):
self
.
assertIsInstance
(
sass_watcher_args
[
1
],
list
)
self
.
assertIsInstance
(
sass_watcher_args
[
1
],
list
)
self
.
assertItemsEqual
(
sass_watcher_args
[
1
],
self
.
expected_sass_directories
)
self
.
assertItemsEqual
(
sass_watcher_args
[
1
],
self
.
expected_sass_directories
)
class
test_collect_assets
(
PaverTestCase
):
@ddt.ddt
class
TestCollectAssets
(
PaverTestCase
):
"""
"""
Test the collectstatic process call
Test the collectstatic process call.
ddt data is organized thusly:
* debug: whether or not collect_assets is called with the debug flag
* specified_log_location: used when collect_assets is called with a specific
log location for collectstatic output
* expected_log_location: the expected string to be used for piping collectstatic logs
"""
"""
def
setUp
(
self
):
pass
def
test_collect_assets_debug
(
self
):
@ddt.data
(
collect_assets
(
"foo"
,
"bar"
,
debug
=
True
)
[{
"expected_log_location"
:
"> /dev/null"
}],
# pipe to /dev/null by default
# TODO
[{
"debug"
:
True
,
"expected_log_location"
:
""
}],
# pipe to console in debug mode
[{
"debug"
:
False
,
"expected_log_location"
:
"> /dev/null"
}],
[{
"specified_log_location"
:
"/foo/bar.log"
,
"expected_log_location"
:
"> /foo/bar.log"
}],
# can use specified log location
[{
"systems"
:
[
"lms"
,
"cms"
],
"expected_log_location"
:
"> /dev/null"
}],
# multiple systems can be called
)
@ddt.unpack
def
test_collect_assets
(
self
,
options
):
"""
Ensure commands sent to the environment for collect_assets are as expected
"""
log_loc
=
options
.
get
(
"expected_log_location"
,
None
)
systems
=
options
.
get
(
"systems"
,
[
"lms"
])
expected_messages
=
self
.
_set_expected_messages
(
log_location
=
log_loc
,
systems
=
systems
)
collect_assets
(
systems
,
"devstack"
,
debug
=
options
.
get
(
"debug"
,
None
),
collectstatic_log
=
options
.
get
(
"specified_log_location"
,
None
)
)
self
.
assertEqual
(
self
.
task_messages
,
expected_messages
)
def
_set_expected_messages
(
self
,
log_location
,
systems
):
expected_messages
=
[]
for
sys
in
systems
:
expected_messages
.
append
(
'python manage.py {system} --settings=devstack collectstatic --noinput {log_loc}'
.
format
(
system
=
sys
,
log_loc
=
log_location
)
)
return
expected_messages
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