def test_validate_inputs_path__(): """ Function to validate right path in json""" baseobj = BaseEagle() baseobj._proj_path = Path(__file__).parent with patch('sys.exit') as exit_mock: baseobj.__validate_inputs_path__() assert not exit_mock.called
def test_validate_wrong_inputs_path__(): """ Function to validate wrong path in json""" baseobj = BaseEagle() baseobj._proj_path = "random_path" with patch('sys.exit') as exit_mock: baseobj.__validate_inputs_path__() assert exit_mock.called
def test_set_get_class_var(self): """ Function to test the base class with a set init values """ baseobj = BaseEagle() baseobj._proj_path = "random_path" self.assertEqual(baseobj.get_proj_path(), "random_path") baseobj._run_pattern_match = "_run_extraction" self.assertEqual(baseobj.get_run_pattern_match(), "SIMEXE") baseobj._run_similarity = "_run_similarity" self.assertEqual(baseobj.get_run_similarity(), "SIMEXE") baseobj._run_cloc_metric = "_run_cloc_metric" self.assertEqual(baseobj.get_run_cloc_metric(), "CLOCEXE") baseobj._run_cyclomatic_complexity = "_run_cyclomatic_complexity" self.assertEqual(baseobj.get_run_cyclomatic_complexity(), "CYCLOEXE") baseobj._annotation = "_annotation" self.assertEqual(baseobj.get_annotation(), "_annotation") baseobj._pattern = "_pattern" self.assertEqual(baseobj.get_pattern(), "_pattern") baseobj._pattern_seperator = "_pattern_seperator" self.assertEqual(baseobj.get_pattern_seperator(), "_pattern_seperator") baseobj._delta = "_delta" self.assertEqual(baseobj.get_delta(), "_delta") baseobj._exclude_extraction = "_exclude_extraction" self.assertEqual(baseobj.get_exclude_extraction(), "_exclude_extraction") baseobj._cyclo_exclude = "_cyclo_exclude" self.assertEqual(baseobj.get_cyclo_exclude(), "_cyclo_exclude") baseobj._report_path = "report_path" self.assertEqual(baseobj.get_report_path(), os.path.join("random_path", "EagleVisionReport")) baseobj._cloc_args = "_cloc_args" self.assertEqual(baseobj.get_cloc_args(), "_cloc_args") baseobj._cyclo_args = "_cyclo_args" self.assertEqual(baseobj.get_cyclo_args(), "_cyclo_args") baseobj._similarity_range = "_similarity_range" self.assertEqual(baseobj.get_similarity_range(), "_similarity_range") baseobj._report_folder = "report_path" self.assertEqual(baseobj.get_report_folder(), "report_path") baseobj._report_folder = None self.assertEqual(baseobj.get_report_folder(), "random_path") baseobj._run_similarity = None baseobj._run_cloc_metric = None baseobj._run_cyclomatic_complexity = None self.assertEqual(baseobj.get_run_similarity(), "") self.assertEqual(baseobj.get_run_cloc_metric(), "") self.assertEqual(baseobj.get_run_cyclomatic_complexity(), "")