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
4b897a21
Commit
4b897a21
authored
Jul 07, 2016
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix log location for bok-choy, add end-to-end mocked tests.
parent
a0d0c22c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletions
+32
-1
pavelib/paver_tests/test_assets.py
+31
-0
pavelib/utils/test/suites/suite.py
+1
-1
No files found.
pavelib/paver_tests/test_assets.py
View file @
4b897a21
...
...
@@ -259,3 +259,34 @@ class TestCollectAssets(PaverTestCase):
)
)
return
expected_messages
@ddt.ddt
class
TestUpdateAssetsTask
(
PaverTestCase
):
"""
These are nearly end-to-end tests, because they observe output from the commandline request,
but do not actually execute the commandline on the terminal/process
"""
@ddt.data
(
[{
"expected_substring"
:
"> /dev/null"
}],
# go to /dev/null by default
[{
"cmd_args"
:
[
"--debug"
],
"expected_substring"
:
"collectstatic --noinput "
}]
# TODO: make this regex
)
@ddt.unpack
def
test_update_assets_task_collectstatic_log_arg
(
self
,
options
):
"""
Scoped test that only looks at what is passed to the collecstatic options
"""
cmd_args
=
options
.
get
(
"cmd_args"
,
[
""
])
expected_substring
=
options
.
get
(
"expected_substring"
,
None
)
call_task
(
'pavelib.assets.update_assets'
,
args
=
cmd_args
)
self
.
assertTrue
(
self
.
_assert_substring_in_list
(
self
.
task_messages
,
expected_substring
))
def
_assert_substring_in_list
(
self
,
messages_list
,
expected_substring
):
"""
Assert that a given string is somewhere in a list of strings
"""
for
message
in
messages_list
:
if
expected_substring
in
message
:
return
True
return
False
pavelib/utils/test/suites/suite.py
View file @
4b897a21
...
...
@@ -71,7 +71,7 @@ class TestSuite(object):
if
not
log_dir
:
sh
(
"paver update_assets --settings=test_static_optimized"
)
else
:
sh
(
"paver update_assets --settings=test_static_optimized --collect-log={log_dir}"
.
format
(
sh
(
"paver update_assets --settings=test_static_optimized --collect-log={log_dir}
/collectstatic.log
"
.
format
(
log_dir
=
log_dir
))
...
...
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