MCPcopy Index your code
hub / github.com/krau/SaveAny-Bot / TestTaskProgressInfoTimeUpdate

Function TestTaskProgressInfoTimeUpdate

api/handlers_test.go:656–667  ·  view source on GitHub ↗

TestTaskProgressInfoTimeUpdate tests that timestamps are updated correctly

(t *testing.T)

Source from the content-addressed store, hash-verified

654
655// TestTaskProgressInfoTimeUpdate tests that timestamps are updated correctly
656func TestTaskProgressInfoTimeUpdate(t *testing.T) {
657 info := RegisterTask("time-test", "directlinks", "local", "downloads", "Test", "")
658 defer DeleteTask("time-test")
659
660 originalTime := info.UpdatedAt
661 time.Sleep(10 * time.Millisecond) // Ensure time difference
662
663 info.UpdateStatus(TaskStatusRunning)
664 if !info.UpdatedAt.After(originalTime) {
665 t.Error("expected UpdatedAt to be updated")
666 }
667}
668
669// TestWebhookPayloadWithNilCompletedAt tests webhook payload with nil completed_at
670func TestWebhookPayloadWithNilCompletedAt(t *testing.T) {

Callers

nothing calls this directly

Calls 4

RegisterTaskFunction · 0.85
DeleteTaskFunction · 0.85
UpdateStatusMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected