mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
28 lines
473 B
Go
28 lines
473 B
Go
package handlers
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"testing"
|
||
|
|
|
||
|
|
"github.com/stretchr/testify/assert"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestGetQueueFromPriority(t *testing.T) {
|
||
|
|
tests := []struct {
|
||
|
|
priority string
|
||
|
|
expected string
|
||
|
|
}{
|
||
|
|
{"critical", "critical"},
|
||
|
|
{"high", "critical"},
|
||
|
|
{"low", "low"},
|
||
|
|
{"", "default"},
|
||
|
|
{"unknown", "default"},
|
||
|
|
}
|
||
|
|
|
||
|
|
for _, tt := range tests {
|
||
|
|
t.Run(tt.priority, func(t *testing.T) {
|
||
|
|
result := GetQueueFromPriority(tt.priority)
|
||
|
|
assert.Equal(t, tt.expected, result)
|
||
|
|
})
|
||
|
|
}
|
||
|
|
}
|