@@ -0,0 +1,2623 @@
+# -*- coding: utf-8 -*-%0A'''%0A    tests.unit.doc_test%0A    ~~~~~~~~~~~~~~~~~~~~%0A'''%0A%0A# Import Python libs%0Afrom __future__ import absolute_import%0Aimport os%0A%0A# Import Salt Testing libs%0Afrom salttesting import TestCase%0A%0A%0A# Import Salt libs%0Aimport integration%0A%0AEXCLUDED_DIRS = %5B%0A    'tests/pkg',%0A    'tests/perf',%0A    'tests/unit/utils/cache_mods',%0A    'tests/unit/modules/inspectlib',%0A    'tests/unit/modules/zypp/',%0A    'tests/unit/templates/files',%0A    'tests/integration/files/',%0A    'tests/integration/cloud/helpers',%0A%5D%0AEXCLUDED_FILES = %5B%0A    'tests/eventlisten.py',%0A    'tests/buildpackage.py',%0A    'tests/saltsh.py',%0A    'tests/minionswarm.py',%0A    'tests/wheeltest.py',%0A    'tests/runtests.py',%0A    'tests/jenkins.py',%0A    'tests/salt-tcpdump.py',%0A    'tests/conftest.py',%0A    'tests/packdump.py',%0A    'tests/consist.py',%0A    'tests/modparser.py',%0A    'tests/committer_parser.py',%0A    'tests/integration/utils/testprogram.py',%0A    'tests/utils/cptestcase.py'%0A%5D%0A%0A%0Aclass BadTestModuleNamesTestCase(TestCase):%0A    '''%0A    Unit test case for testing bad names for test modules%0A    '''%0A%0A    maxDiff = None%0A%0A    def test_module_name(self):%0A        '''%0A        Make sure all test modules conform to the test_*.py naming scheme%0A        '''%0A        excluded_dirs = tuple(EXCLUDED_DIRS)%0A        code_dir = integration.CODE_DIR%0A        tests_dir = os.path.join(code_dir, 'tests')%0A        bad_names = %5B%5D%0A        for root, dirs, files in os.walk(tests_dir):%0A            reldir = os.path.relpath(root, code_dir)%0A            if reldir.startswith(excluded_dirs) or reldir.endswith('__pycache__'):%0A                continue%0A            for fname in files:%0A                if fname == '__init__.py' or not fname.endswith('.py'):%0A                    continue%0A                relpath = os.path.join(reldir, fname)%0A                if relpath in EXCLUDED_FILES:%0A                    continue%0A                if not fname.startswith('test_'):%0A                    bad_names.append(relpath)%0A%0A        error_msg = '%5Cn%5CnPlease rename the following files:%5Cn'%0A        for path in bad_names:%0A            directory, filename = path.rsplit(os.sep, 1)%0A            filename, ext = os.path.splitext(filename)%0A            error_msg += '  %7B%7D -%3E %7B%7D/test_%7B%7D.py%5Cn'.format(path, directory, filename.split('_test')%5B0%5D)%0A%0A        error_msg += '%5CnIf you believe one of the entries above should be ignored, please add it to either%5Cn'%0A        error_msg += '%5C'EXCLUDED_DIRS%5C' or %5C'EXCLUDED_FILES%5C' in %5C'tests/unit/test_module_names.py%5C'.%5Cn'%0A        error_msg += 'If it is a tests module, then please rename as suggested.'%0A        self.assertEqual(%5B%5D, bad_names, error_msg)%0A

Add test case to make sure we always proper test module names from now on