def test_init(self):
        """Test initialization"""

        mod_analyzer = ModuleAnalyzer()
        self.assertIsInstance(mod_analyzer, ModuleAnalyzer)
        self.assertIsInstance(mod_analyzer.analyzer, PyLint)

        mod_analyzer = ModuleAnalyzer(kind=FLAKE8)
        self.assertIsInstance(mod_analyzer, ModuleAnalyzer)
        self.assertIsInstance(mod_analyzer.analyzer, Flake8)
Beispiel #2
0
    def test_analyze(self):
        """Test whether the analyze method works"""

        module_path = os.path.join(self.tmp_path, 'graaltest', 'perceval')
        mod_analyzer = ModuleAnalyzer()
        result = mod_analyzer.analyze(module_path)

        self.assertNotIn('modules', result)
        self.assertIn('quality', result)
        self.assertTrue(type(result['quality']), str)
        self.assertIn('num_modules', result)
        self.assertTrue(type(result['num_modules']), int)
        self.assertIn('warnings', result)
        self.assertTrue(type(result['warnings']), int)
Beispiel #3
0
    def test_init(self):
        """Test initialization"""

        mod_analyzer = ModuleAnalyzer()

        self.assertIsInstance(mod_analyzer, ModuleAnalyzer)
        self.assertIsInstance(mod_analyzer.lint, Lint)