33 lines
637 B
Go
33 lines
637 B
Go
package broker
|
|
|
|
import (
|
|
"local/storage"
|
|
"local/truckstop/config"
|
|
"testing"
|
|
|
|
"golang.org/x/time/rate"
|
|
)
|
|
|
|
func TestFastExactLogin(t *testing.T) {
|
|
limiter = rate.NewLimiter(rate.Limit(60.0), 1)
|
|
fe := NewFastExact().WithMock()
|
|
_ = fe
|
|
db := storage.NewMap()
|
|
if err := fe._login("u", "p", db); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestFastExactSearch(t *testing.T) {
|
|
limiter = rate.NewLimiter(rate.Limit(60.0), 1)
|
|
fe := NewFastExact().WithMock()
|
|
_ = fe
|
|
db := storage.NewMap()
|
|
_ = db
|
|
if jobs, err := fe.search([]config.State{config.State("NC"), config.State("SC")}); err != nil {
|
|
t.Fatal(err)
|
|
} else {
|
|
t.Fatal(jobs)
|
|
}
|
|
}
|