def test_archive_scan(self): """Verify cloud readiness index for SampleWebApp-master.zip and rulebase.csv""" archive = "SampleWebApp-master.zip" if not os.path.isfile(archive): archive = os.path.join("ephemerol", "test", archive) results_stats = Scanner.scan_archive(archive) self.assertEqual(97.44, results_stats.cloud_readiness_index)
def test_java_scan(self): Scanner.load_rules(os.path.join("ephemerol", "test", "rulebase.csv")) df = Scanner.scan_archive(os.path.join("ephemerol", "test", "SampleWebApp-master.zip")) #print(df) self.assertEqual(1, df[(df.refactor_rating == 3)].shape[0]) self.assertEqual(5, df[(df.refactor_rating == 1)].shape[0]) self.assertEqual(11, df[(df.refactor_rating == 0)].shape[0]) self.assertEqual(92, 100 - df.refactor_rating.cumsum().tail(1).item())
def test_archive_scan_yaml(self): Scanner.load_yaml_rules(self.path_helper("rulebase.yml")) results_stats = Scanner.scan_archive( self.path_helper("SampleWebApp-master.zip")) self.assertEqual(97.44, results_stats.cloud_readiness_index)
def test_archive_scan(self): """Verify cloud readiness index for SampleWebApp-master.zip and rulebase.csv""" results_stats = Scanner.scan_archive(os.path.join("ephemerol", "test", "SampleWebApp-master.zip")) stats = results_stats[1] self.assertEqual(97.44, stats.cloud_readiness_index)
def test_archive_scan_yaml(self): Scanner.load_yaml_rules(self.path_helper("rulebase.yml")) results_stats = Scanner.scan_archive(self.path_helper("SampleWebApp-master.zip")) self.assertEqual(97.44, results_stats.cloud_readiness_index)