def test_cfn_cluster_delete_fail(self): template_url = setup_configurations() args = CreateClusterArgs(template_url, True) with self.assertRaises(SystemExit) as sys_ex: pcluster.delete(args) self.assertEqual(sys_ex.exception.code, 1) log = test_log_stream.getvalue() error_prefix = "CRITICAL:" self.assertTrue(error_prefix in log)
def test_cfn_cluster_delete(self): template_url = setup_configurations() args = CreateClusterArgs(template_url, True) pcluster.create(args) with self.assertRaises(SystemExit) as sys_ex: pcluster.delete(args) self.assertEqual(sys_ex.exception.code, 0) success_message = "Cluster deleted successfully" log = test_log_stream.getvalue() self.assertTrue(success_message in log)
def delete(args): pcluster.delete(args)