-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Charles Daniels
committed
Aug 29, 2024
1 parent
dbfd68c
commit e893548
Showing
4 changed files
with
79 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//go:build integration | ||
// +build integration | ||
|
||
package capabilities | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
) | ||
|
||
// Since this test requires internet access, we hide it behind a flag. | ||
|
||
func TestLookupFromURL(t *testing.T) { | ||
t.Parallel() | ||
|
||
// Test that we can load a one of the existing OPA capabilities files | ||
// via GitHub. | ||
|
||
caps, err := Lookup( | ||
context.Background(), | ||
"https://raw.githubusercontent.com/open-policy-agent/opa/main/capabilities/v0.55.0.json", | ||
) | ||
if err != nil { | ||
t.Errorf("unexpected error from Lookup: %v", err) | ||
} | ||
|
||
if len(caps.Builtins) != 193 { | ||
t.Errorf("OPA v0.55.0 capabilities should have 193 builtins, not %d", len(caps.Builtins)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters