2020-01-09 01:21:09 +01:00
|
|
|
package classify
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestLabelRules_Find(t *testing.T) {
|
2021-09-23 23:46:17 +02:00
|
|
|
result, ok := Rules.Find("cat")
|
2021-02-21 17:18:36 +01:00
|
|
|
assert.True(t, ok)
|
2020-01-09 01:21:09 +01:00
|
|
|
assert.Equal(t, "cat", result.Label)
|
|
|
|
assert.Equal(t, "animal", result.Categories[0])
|
|
|
|
assert.Equal(t, 5, result.Priority)
|
|
|
|
}
|