- 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.
22 lines
533 B
Go
22 lines
533 B
Go
package api
|
|
|
|
import "testing"
|
|
|
|
func TestParseBlenderFrame(t *testing.T) {
|
|
frame, ok := parseBlenderFrame("Info Fra:2470 Mem:12.00M")
|
|
if !ok || frame != 2470 {
|
|
t.Fatalf("parseBlenderFrame() = (%d,%v), want (2470,true)", frame, ok)
|
|
}
|
|
if _, ok := parseBlenderFrame("no frame here"); ok {
|
|
t.Fatal("expected parse to fail for non-frame text")
|
|
}
|
|
}
|
|
|
|
func TestJobTaskCounts_Progress(t *testing.T) {
|
|
c := &jobTaskCounts{total: 10, completed: 4}
|
|
if got := c.progress(); got != 40 {
|
|
t.Fatalf("progress() = %v, want 40", got)
|
|
}
|
|
}
|
|
|