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
fedba149
Commit
fedba149
authored
10 years ago
by
Ben Patterson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5118 from edx/benp/paver-tests
Add tests for paver bok_choy commands
parents
896764c9
ae20b106
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletions
+46
-1
pavelib/paver_tests/__init__.py
+0
-0
pavelib/paver_tests/test_paver_bok_choy_cmds.py
+44
-0
pavelib/tests.py
+1
-1
pavelib/utils/envs.py
+1
-0
No files found.
pavelib/paver_tests/__init__.py
0 → 100644
View file @
fedba149
This diff is collapsed.
Click to expand it.
pavelib/paver_tests/test_paver_bok_choy_cmds.py
0 → 100644
View file @
fedba149
import
os
import
unittest
from
pavelib.utils.test.suites.bokchoy_suite
import
BokChoyTestSuite
REPO_DIR
=
os
.
getcwd
()
class
TestPaverBokChoy
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
request
=
BokChoyTestSuite
(
''
)
def
_expected_command
(
self
,
expected_text_append
):
if
expected_text_append
:
expected_text_append
=
"/"
+
expected_text_append
expected_statement
=
(
"SCREENSHOT_DIR='{repo_dir}/test_root/log' "
"HAR_DIR='{repo_dir}/test_root/log/hars' "
"SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log' "
"nosetests {repo_dir}/common/test/acceptance/tests{exp_text} "
"--with-xunit "
"--xunit-file={repo_dir}/reports/bok_choy/xunit.xml "
"--verbosity=2 "
.
format
(
repo_dir
=
REPO_DIR
,
exp_text
=
expected_text_append
))
return
expected_statement
def
test_default_bokchoy
(
self
):
self
.
assertEqual
(
self
.
request
.
cmd
,
self
.
_expected_command
(
''
))
def
test_suite_request_bokchoy
(
self
):
self
.
request
.
test_spec
=
"test_foo.py"
self
.
assertEqual
(
self
.
request
.
cmd
,
self
.
_expected_command
(
self
.
request
.
test_spec
))
def
test_class_request_bokchoy
(
self
):
self
.
request
.
test_spec
=
"test_foo.py:FooTest"
self
.
assertEqual
(
self
.
request
.
cmd
,
self
.
_expected_command
(
self
.
request
.
test_spec
))
def
test_case_request_bokchoy
(
self
):
self
.
request
.
test_spec
=
"test_foo.py:FooTest.test_bar"
self
.
assertEqual
(
self
.
request
.
cmd
,
self
.
_expected_command
(
self
.
request
.
test_spec
))
# TODO: Test when bok_choy test file is in a subdir
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pavelib/tests.py
View file @
fedba149
...
...
@@ -79,7 +79,7 @@ def test_system(options):
])
def
test_lib
(
options
):
"""
Run tests for common/lib/
Run tests for common/lib/
and pavelib/ (paver-tests)
"""
lib
=
getattr
(
options
,
'lib'
,
None
)
test_id
=
getattr
(
options
,
'test_id'
,
lib
)
...
...
This diff is collapsed.
Click to expand it.
pavelib/utils/envs.py
View file @
fedba149
...
...
@@ -109,6 +109,7 @@ class Env(object):
for
item
in
(
REPO_ROOT
/
"common/lib"
)
.
listdir
():
if
(
REPO_ROOT
/
'common/lib'
/
item
)
.
isdir
():
LIB_TEST_DIRS
.
append
(
path
(
"common/lib"
)
/
item
.
basename
())
LIB_TEST_DIRS
.
append
(
path
(
"pavelib/paver_tests"
))
# Directory for i18n test reports
I18N_REPORT_DIR
=
REPORT_DIR
/
'i18n'
...
...
This diff is collapsed.
Click to expand it.
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