Add tests for main package, manager, and various components
- 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.
This commit is contained in:
30
web/embed_test.go
Normal file
30
web/embed_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user