Merge "Move hacking checks to tests dir"

This commit is contained in:
Zuul 2019-10-07 21:23:19 +00:00 committed by Gerrit Code Review
commit b095236639
6 changed files with 7 additions and 7 deletions

View File

@ -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/.*$

View File

@ -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
""" """

View File

@ -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

View File

@ -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"]:

View File

@ -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]