main
1package api
2
3import (
4 "testing"
5 "time"
6)
7
8func TestConstants(t *testing.T) {
9 // Test task status constants
10 if TaskStatusCompleted != "completed" {
11 t.Errorf("Expected TaskStatusCompleted to be 'completed', got %q", TaskStatusCompleted)
12 }
13 if TaskStatusError != "error" {
14 t.Errorf("Expected TaskStatusError to be 'error', got %q", TaskStatusError)
15 }
16 if TaskStatusSubmitted != "submitted" {
17 t.Errorf("Expected TaskStatusSubmitted to be 'submitted', got %q", TaskStatusSubmitted)
18 }
19
20 // Test timeout constants
21 if DefaultTaskTimeout != 30*time.Second {
22 t.Errorf("Expected DefaultTaskTimeout to be 30s, got %v", DefaultTaskTimeout)
23 }
24 if DefaultPollInterval != 1*time.Second {
25 t.Errorf("Expected DefaultPollInterval to be 1s, got %v", DefaultPollInterval)
26 }
27 if DefaultDownloadTimeout != 60*time.Second {
28 t.Errorf("Expected DefaultDownloadTimeout to be 60s, got %v", DefaultDownloadTimeout)
29 }
30
31 // Test numeric constants
32 if ProgressDotInterval != 5 {
33 t.Errorf("Expected ProgressDotInterval to be 5, got %d", ProgressDotInterval)
34 }
35 if EstimatedChunkSizeKB != 512 {
36 t.Errorf("Expected EstimatedChunkSizeKB to be 512, got %d", EstimatedChunkSizeKB)
37 }
38 if UUIDLength != 36 {
39 t.Errorf("Expected UUIDLength to be 36, got %d", UUIDLength)
40 }
41 if UUIDLengthNoHyphens != 32 {
42 t.Errorf("Expected UUIDLengthNoHyphens to be 32, got %d", UUIDLengthNoHyphens)
43 }
44 if UUIDDisplayLength != 8 {
45 t.Errorf("Expected UUIDDisplayLength to be 8, got %d", UUIDDisplayLength)
46 }
47}