23 lines
617 B
Go
23 lines
617 B
Go
package insight
|
|
|
|
import "testing"
|
|
|
|
func TestParseModuleRejectsUnscopedValues(t *testing.T) {
|
|
for _, value := range []string{"overview", "payments", "fees", "peers", "transactions", "growth"} {
|
|
if _, ok := ParseModule(value); !ok {
|
|
t.Fatalf("expected %s to be valid", value)
|
|
}
|
|
}
|
|
for _, value := range []string{"", "transaction-detail", "merchant_2", "OVERVIEW"} {
|
|
if _, ok := ParseModule(value); ok {
|
|
t.Fatalf("expected %s to be invalid", value)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestStaleAlwaysCapsConfidence(t *testing.T) {
|
|
if got := confidenceFor(FreshnessStale); got != ConfidenceLow {
|
|
t.Fatalf("got %s", got)
|
|
}
|
|
}
|