Move unit tests from tests/unit/ to internal/ following Go conventions: - tests/unit/api/* -> internal/api/* (WebSocket handlers, helpers, duplicate detection) - tests/unit/audit/* -> internal/audit/* (alert, sealed, verifier tests) - tests/unit/auth/* -> internal/auth/* (API key, keychain, user manager) - tests/unit/crypto/kms/* -> internal/auth/kms/* (cache, protocol tests) Update import paths in test files to reflect new locations. Benefits: - Tests live alongside the code they test - Easier navigation and maintenance - Clearer package boundaries - Follows standard Go project layout
20 lines
632 B
Go
20 lines
632 B
Go
//nolint:revive // Package name 'api' is appropriate for this test package
|
|
package api_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
wspkg "github.com/jfraeys/fetch_ml/internal/api/ws"
|
|
)
|
|
|
|
func TestWSHandlerNewQueueOpcodeExists(t *testing.T) {
|
|
if wspkg.OpcodeQueueJobWithNote != 0x1B {
|
|
t.Fatalf("expected OpcodeQueueJobWithNote to be 0x1B, got %d", wspkg.OpcodeQueueJobWithNote)
|
|
}
|
|
if wspkg.OpcodeAnnotateRun != 0x1C {
|
|
t.Fatalf("expected OpcodeAnnotateRun to be 0x1C, got %d", wspkg.OpcodeAnnotateRun)
|
|
}
|
|
if wspkg.OpcodeSetRunNarrative != 0x1D {
|
|
t.Fatalf("expected OpcodeSetRunNarrative to be 0x1D, got %d", wspkg.OpcodeSetRunNarrative)
|
|
}
|
|
}
|