Merge "Move hacking checks to tests dir"
This commit is contained in:
commit
b095236639
@ -18,8 +18,8 @@
|
|||||||
irrelevant-files: &functional-irrelevant-files
|
irrelevant-files: &functional-irrelevant-files
|
||||||
- ^.*\.rst$
|
- ^.*\.rst$
|
||||||
- ^api-ref/.*$
|
- ^api-ref/.*$
|
||||||
- ^cinder/hacking/.*$
|
|
||||||
- ^cinder/locale/.*$
|
- ^cinder/locale/.*$
|
||||||
|
- ^cinder/tests/hacking/.*$
|
||||||
- ^cinder/tests/unit.*$
|
- ^cinder/tests/unit.*$
|
||||||
- ^contrib/block-box.*$
|
- ^contrib/block-box.*$
|
||||||
- ^doc/.*$
|
- ^doc/.*$
|
||||||
@ -38,9 +38,9 @@
|
|||||||
- ^.*\.rst$
|
- ^.*\.rst$
|
||||||
- ^api-ref/.*$
|
- ^api-ref/.*$
|
||||||
- ^cinder/cmd/status\.py$
|
- ^cinder/cmd/status\.py$
|
||||||
- ^cinder/hacking/.*$
|
|
||||||
- ^cinder/locale/.*$
|
- ^cinder/locale/.*$
|
||||||
- ^cinder/tests/functional.*$
|
- ^cinder/tests/functional.*$
|
||||||
|
- ^cinder/tests/hacking/.*$
|
||||||
- ^cinder/tests/unit.*$
|
- ^cinder/tests/unit.*$
|
||||||
- ^contrib/block-box.*$
|
- ^contrib/block-box.*$
|
||||||
- ^doc/.*$
|
- ^doc/.*$
|
||||||
|
@ -27,7 +27,7 @@ Guidelines for writing new hacking checks
|
|||||||
on the N3xx value.
|
on the N3xx value.
|
||||||
- List the new rule in the top level HACKING.rst file
|
- List the new rule in the top level HACKING.rst file
|
||||||
- Add test cases for each new rule to
|
- Add test cases for each new rule to
|
||||||
cinder/tests/test_hacking.py
|
cinder/tests/unit/test_hacking.py
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
@ -18,13 +18,13 @@ import textwrap
|
|||||||
import mock
|
import mock
|
||||||
import pycodestyle
|
import pycodestyle
|
||||||
|
|
||||||
from cinder.hacking import checks
|
|
||||||
from cinder import test
|
from cinder import test
|
||||||
|
from cinder.tests.hacking import checks
|
||||||
|
|
||||||
|
|
||||||
@ddt.ddt
|
@ddt.ddt
|
||||||
class HackingTestCase(test.TestCase):
|
class HackingTestCase(test.TestCase):
|
||||||
"""This class tests the hacking checks in cinder.hacking.checks
|
"""This class tests cinder's hacking checks.
|
||||||
|
|
||||||
This class ensures that Cinder's hacking checks are working by passing
|
This class ensures that Cinder's hacking checks are working by passing
|
||||||
strings to the check methods like the pep8/flake8 parser would. The parser
|
strings to the check methods like the pep8/flake8 parser would. The parser
|
||||||
|
@ -106,7 +106,7 @@ if __name__ == "__main__":
|
|||||||
for atree in dir_trees_list:
|
for atree in dir_trees_list:
|
||||||
|
|
||||||
if atree in ["tools/config/generate_cinder_opts.py",
|
if atree in ["tools/config/generate_cinder_opts.py",
|
||||||
"cinder/hacking/checks.py",
|
"cinder/tests/hacking/checks.py",
|
||||||
"cinder/volume/configuration.py",
|
"cinder/volume/configuration.py",
|
||||||
"cinder/test.py",
|
"cinder/test.py",
|
||||||
"cinder/cmd/status.py"]:
|
"cinder/cmd/status.py"]:
|
||||||
|
2
tox.ini
2
tox.ini
@ -207,7 +207,7 @@ exclude = .git,.venv,.tox,dist,tools,doc/ext,*egg,build
|
|||||||
max-complexity=30
|
max-complexity=30
|
||||||
|
|
||||||
[hacking]
|
[hacking]
|
||||||
local-check-factory = cinder.hacking.checks.factory
|
local-check-factory = cinder.tests.hacking.checks.factory
|
||||||
import_exceptions = cinder.i18n
|
import_exceptions = cinder.i18n
|
||||||
|
|
||||||
[doc8]
|
[doc8]
|
||||||
|
Loading…
Reference in New Issue
Block a user