diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-04-20 18:39:09 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2025-04-20 18:39:13 -0400 |
| commit | 2757699c6645ca54cde4c00ff1b079bfa01d2b39 (patch) | |
| tree | ef7b0e43afe5de4abb105d5c1cf44d3093411824 | |
| parent | 0b0ce1b2afed4f9a1afb4fbc20805f74ad25cfa9 (diff) | |
| download | anubis-2757699c6645ca54cde4c00ff1b079bfa01d2b39.tar.xz anubis-2757699c6645ca54cde4c00ff1b079bfa01d2b39.zip | |
lib: add missing test
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | lib/anubis_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/anubis_test.go b/lib/anubis_test.go index eca6869..60b7913 100644 --- a/lib/anubis_test.go +++ b/lib/anubis_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/TecharoHQ/anubis" + "github.com/TecharoHQ/anubis/data" "github.com/TecharoHQ/anubis/internal" "github.com/TecharoHQ/anubis/lib/policy" ) @@ -56,7 +57,19 @@ func makeChallenge(t *testing.T, ts *httptest.Server) challenge { } func TestLoadPolicies(t *testing.T) { + for _, fname := range []string{"botPolicies.json", "botPolicies.yaml"} { + t.Run(fname, func(t *testing.T) { + fin, err := data.BotPolicies.Open(fname) + if err != nil { + t.Fatal(err) + } + defer fin.Close() + if _, err := policy.ParseConfig(fin, fname, 4); err != nil { + t.Fatal(err) + } + }) + } } // Regression test for CVE-2025-24369 |
