Example #1
0
    def test_get_coverage_works_for_dotted_app_labels(self):
        files = get_coverage_files(['dotted.dotted_test_app'],
                                   ignore_dirs=[],
                                   ignore_files=['tests.py'])

        self.assertEqual(1, len(files))
        expected_path = os.path.join(os.path.dirname(dotted_test_app.__file__),
                                     '__init__.py')
        self.assertIn(expected_path, files)
    def test_get_coverage_works_for_dotted_app_labels(self):
        files = get_coverage_files(
            ['dotted.dotted_test_app'],
            ignore_dirs=[],
            ignore_files=['tests.py']
        )

        self.assertEqual(1, len(files))
        expected_path = os.path.join(os.path.dirname(dotted_test_app.__file__), '__init__.py')
        self.assertIn(expected_path, files)
Example #3
0
 def test_get_coverage_gets_the_expected_files(self):
     coverage_files = get_coverage_files(['test_app_no_models'],
                                         ignore_dirs=[],
                                         ignore_files=['tests.py'])
     expected_coverage_file_names = ['__init__.py', 'views.py']
     full_paths = [
         os.path.join(os.path.dirname(test_app_no_models.__file__),
                      file_name)
         for file_name in expected_coverage_file_names
     ]
     self.assertEqual(len(full_paths), len(coverage_files))
     self.assertTrue(all(path in coverage_files for path in full_paths))
 def test_get_coverage_gets_the_expected_files(self):
     coverage_files = get_coverage_files(['test_app_no_models'], ignore_dirs=[], ignore_files=['tests.py'])
     expected_coverage_file_names = ['__init__.py', 'views.py']
     full_paths = [os.path.join(os.path.dirname(test_app_no_models.__file__), file_name) for file_name in expected_coverage_file_names]
     self.assertEqual(len(full_paths), len(coverage_files))
     self.assertTrue(all(path in coverage_files for path in full_paths))
Example #5
0
 def test_get_coverage_raises_error_if_app_is_not_installed(self):
     with self.assertRaises(ImproperlyConfigured):
         get_coverage_files(['test'], ignore_dirs=[], ignore_files=[])
 def test_get_coverage_raises_error_if_app_is_not_installed(self):
     with self.assertRaises(ImproperlyConfigured):
         get_coverage_files(['test'], ignore_dirs=[], ignore_files=[])