feat: cache module add CreateHandler api (#98)

This commit is contained in:
ChristopherHX
2025-04-26 16:58:30 +02:00
committed by GitHub
parent 258de0fa37
commit bb13ab4f84
2 changed files with 68 additions and 1 deletions

View File

@@ -695,3 +695,13 @@ func TestHandler_gcCache(t *testing.T) {
}
require.NoError(t, db.Close())
}
func TestCreateHandler(t *testing.T) {
dir := filepath.Join(t.TempDir(), "artifactcache")
handler, router, err := CreateHandler(dir, "http://localhost:8080", nil)
require.NoError(t, err)
require.NotNil(t, handler)
require.NotNil(t, router)
require.Equal(t, "http://localhost:8080", handler.ExternalURL())
}