def delete_technique(bundle_name): try: path = get_path_from_args(request) ncf.delete_technique(bundle_name,path) return jsonify({ "data": { "bundle_name" : bundle_name } }) except Exception as e: return format_error(e, "technique deletion", 500)
def delete_technique(bundle_name): try: path = get_path_from_args(request) ncf.delete_technique(bundle_name, path) return jsonify({"data": {"bundle_name": bundle_name}}) except Exception as e: return format_error(e, "technique deletion", 500)
def test_delete_technique(self): """Check if a technique file is correctly deleted""" ncf.write_technique(self.technique_metadata, os.path.realpath("write_test")) ncf.delete_technique(self.technique_metadata['bundle_name'], os.path.realpath("write_test")) result = not os.path.exists(os.path.realpath(os.path.join("write_test", "50_techniques", self.technique_metadata['bundle_name']))) # Clean shutil.rmtree(os.path.realpath(os.path.join("write_test", "50_techniques"))) self.assertTrue(result)
def delete_technique(bundle_name): if "path" in request.args: path = request.args['path'] else: path = "" try: ncf.delete_technique(bundle_name,path) except ncf.NcfError, ex: return jsonify( { 'error' : ex.message } ), 500
def test_delete_technique(self): """Check if a technique file is correctly deleted""" ncf.write_technique(self.technique_metadata, os.path.realpath("write_test")) ncf.delete_technique(self.technique_metadata['bundle_name'], os.path.realpath("write_test")) result = not os.path.exists( os.path.realpath( os.path.join("write_test", "50_techniques", self.technique_metadata['bundle_name']))) # Clean shutil.rmtree( os.path.realpath(os.path.join("write_test", "50_techniques"))) self.assertTrue(result)