Skip to content

Commit

Permalink
add 404 test case for DeleteRoutingPolicy()
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismarget-j committed Aug 20, 2023
1 parent 7086b2b commit 8ae2939
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions apstra/two_stage_l3_clos_routing_policies_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,22 @@ func TestRoutingPolicy404(t *testing.T) {
_, err := bpClient.GetRoutingPolicy(ctx, "bogus")
if err == nil {
t.Fatal("should have gotten an error")
} else {
var clientErr ApstraClientErr
if !errors.As(err, &clientErr) || clientErr.Type() != ErrNotfound {
t.Fatal("error should have been something 404-ish")
}
}
var clientErr ApstraClientErr
if !errors.As(err, &clientErr) || clientErr.Type() != ErrNotfound {
t.Fatal("error should have been something 404-ish")

log.Printf("testing DeleteRoutingPolicy() against %s %s (%s)", client.clientType, clientName, client.client.ApiVersion())
err = bpClient.DeleteRoutingPolicy(ctx, "bogus")
if err == nil {
t.Fatal("should have gotten an error")
} else {
var clientErr ApstraClientErr
if !errors.As(err, &clientErr) || clientErr.Type() != ErrNotfound {
t.Fatal("error should have been something 404-ish")
}
}
}
}

0 comments on commit 8ae2939

Please sign in to comment.