make edge helpers + more mock safe (#2357)
* make getPreviousAdjacentEdge mock safe * make more functions mock safe
This commit is contained in:
@ -172,6 +172,9 @@ pub async fn get_opposite_edge(args: Args) -> Result<MemoryItem, KclError> {
|
||||
name = "getOppositeEdge",
|
||||
}]
|
||||
async fn inner_get_opposite_edge(tag: String, extrude_group: Box<ExtrudeGroup>, args: Args) -> Result<Uuid, KclError> {
|
||||
if args.ctx.is_mock {
|
||||
return Ok(Uuid::new_v4());
|
||||
}
|
||||
let tagged_path = extrude_group
|
||||
.sketch_group_values
|
||||
.iter()
|
||||
@ -260,6 +263,9 @@ async fn inner_get_next_adjacent_edge(
|
||||
extrude_group: Box<ExtrudeGroup>,
|
||||
args: Args,
|
||||
) -> Result<Uuid, KclError> {
|
||||
if args.ctx.is_mock {
|
||||
return Ok(Uuid::new_v4());
|
||||
}
|
||||
let tagged_path = extrude_group
|
||||
.sketch_group_values
|
||||
.iter()
|
||||
@ -353,6 +359,9 @@ async fn inner_get_previous_adjacent_edge(
|
||||
extrude_group: Box<ExtrudeGroup>,
|
||||
args: Args,
|
||||
) -> Result<Uuid, KclError> {
|
||||
if args.ctx.is_mock {
|
||||
return Ok(Uuid::new_v4());
|
||||
}
|
||||
let tagged_path = extrude_group
|
||||
.sketch_group_values
|
||||
.iter()
|
||||
|
||||
@ -177,6 +177,10 @@ async fn inner_pattern_linear_3d(
|
||||
extrude_group: Box<ExtrudeGroup>,
|
||||
args: Args,
|
||||
) -> Result<Vec<Box<ExtrudeGroup>>, KclError> {
|
||||
if args.ctx.is_mock {
|
||||
return Ok(vec![extrude_group.clone()]);
|
||||
}
|
||||
|
||||
let geometries = pattern_linear(
|
||||
LinearPattern::ThreeD(data),
|
||||
Geometry::ExtrudeGroup(extrude_group),
|
||||
|
||||
@ -314,6 +314,9 @@ pub async fn get_edge(args: Args) -> Result<MemoryItem, KclError> {
|
||||
name = "getEdge",
|
||||
}]
|
||||
async fn inner_get_edge(tag: String, extrude_group: Box<ExtrudeGroup>, args: Args) -> Result<Uuid, KclError> {
|
||||
if args.ctx.is_mock {
|
||||
return Ok(Uuid::new_v4());
|
||||
}
|
||||
let tagged_path = extrude_group
|
||||
.sketch_group_values
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user