- Introduced unit tests for the main package to ensure compilation. - Added tests for the manager, including validation of upload sessions and handling of Blender binary paths. - Implemented tests for job token generation and validation, ensuring security and integrity. - Created tests for configuration management and database schema to verify functionality. - Added tests for logger and runner components to enhance overall test coverage and reliability.
31 lines
608 B
Go
31 lines
608 B
Go
package web
|
|
|
|
import (
|
|
"net/http/httptest"
|
|
"testing"
|
|
)
|
|
|
|
func TestGetStaticFileSystem_NonNil(t *testing.T) {
|
|
fs := GetStaticFileSystem()
|
|
if fs == nil {
|
|
t.Fatal("static filesystem should not be nil")
|
|
}
|
|
}
|
|
|
|
func TestStaticHandler_ServesWithoutPanic(t *testing.T) {
|
|
h := StaticHandler()
|
|
rr := httptest.NewRecorder()
|
|
req := httptest.NewRequest("GET", "/assets/does-not-exist.txt", nil)
|
|
h.ServeHTTP(rr, req)
|
|
if rr.Code == 0 {
|
|
t.Fatal("handler should write a status code")
|
|
}
|
|
}
|
|
|
|
func TestGetTemplateFS_NonNil(t *testing.T) {
|
|
if GetTemplateFS() == nil {
|
|
t.Fatal("template fs should not be nil")
|
|
}
|
|
}
|
|
|