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
ae20b106
Commit
ae20b106
authored
Sep 05, 2014
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set paver command tests to run as part of unit test lib suites.
parent
6c757044
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
22 deletions
+46
-22
pavelib/paver_tests/__init__.py
+0
-0
pavelib/paver_tests/test_paver_bok_choy_cmds.py
+44
-0
pavelib/tests.py
+1
-1
pavelib/tests/test_paver_bok_choy_cmds.py
+0
-21
pavelib/utils/envs.py
+1
-0
No files found.
pavelib/tests/__init__.py
→
pavelib/
paver_
tests/__init__.py
View file @
ae20b106
File moved
pavelib/paver_tests/test_paver_bok_choy_cmds.py
0 → 100644
View file @
ae20b106
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
pavelib/tests.py
View file @
ae20b106
...
@@ -79,7 +79,7 @@ def test_system(options):
...
@@ -79,7 +79,7 @@ def test_system(options):
])
])
def
test_lib
(
options
):
def
test_lib
(
options
):
"""
"""
Run tests for common/lib/
Run tests for common/lib/
and pavelib/ (paver-tests)
"""
"""
lib
=
getattr
(
options
,
'lib'
,
None
)
lib
=
getattr
(
options
,
'lib'
,
None
)
test_id
=
getattr
(
options
,
'test_id'
,
lib
)
test_id
=
getattr
(
options
,
'test_id'
,
lib
)
...
...
pavelib/tests/test_paver_bok_choy_cmds.py
deleted
100644 → 0
View file @
6c757044
import
os
import
unittest
from
pavelib.utils.test.suites.bokchoy_suite
import
BokChoyTestSuite
REPO_DIR
=
os
.
getcwd
()
class
TestPaverBokChoy
(
unittest
.
TestCase
):
def
test_default_bokchoy
(
self
):
command
=
BokChoyTestSuite
(
'paver -t test_bokchoy'
)
expected_output
=
(
"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 "
"--with-xunit "
"--xunit-file={repo_dir}/reports/bok_choy/xunit.xml "
"--verbosity=2 "
.
format
(
repo_dir
=
REPO_DIR
))
print
expected_output
self
.
assertTrue
(
command
.
cmd
==
expected_output
)
pavelib/utils/envs.py
View file @
ae20b106
...
@@ -109,6 +109,7 @@ class Env(object):
...
@@ -109,6 +109,7 @@ class Env(object):
for
item
in
(
REPO_ROOT
/
"common/lib"
)
.
listdir
():
for
item
in
(
REPO_ROOT
/
"common/lib"
)
.
listdir
():
if
(
REPO_ROOT
/
'common/lib'
/
item
)
.
isdir
():
if
(
REPO_ROOT
/
'common/lib'
/
item
)
.
isdir
():
LIB_TEST_DIRS
.
append
(
path
(
"common/lib"
)
/
item
.
basename
())
LIB_TEST_DIRS
.
append
(
path
(
"common/lib"
)
/
item
.
basename
())
LIB_TEST_DIRS
.
append
(
path
(
"pavelib/paver_tests"
))
# Directory for i18n test reports
# Directory for i18n test reports
I18N_REPORT_DIR
=
REPORT_DIR
/
'i18n'
I18N_REPORT_DIR
=
REPORT_DIR
/
'i18n'
...
...
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