diff --git a/broker/broker_test.go b/broker/broker_test.go index 9a5c8e3..3474b9a 100644 --- a/broker/broker_test.go +++ b/broker/broker_test.go @@ -3,6 +3,7 @@ package broker import ( "fmt" "local/storage" + "local/truckstop/logtr" "net/http" "net/http/httptest" "strconv" @@ -14,6 +15,7 @@ import ( ) func TestBrokerInterface(t *testing.T) { + logtr.SetLevel(logtr.SOS) var b Broker b = FastExact{} b = NTGVision{} @@ -21,6 +23,7 @@ func TestBrokerInterface(t *testing.T) { } func TestDoCookies(t *testing.T) { + logtr.SetLevel(logtr.SOS) limiter = rate.NewLimiter(rate.Limit(20.0), 1) calls := 0 db := storage.NewMap() diff --git a/broker/fastexact.go b/broker/fastexact.go index bb58cc8..00eb28f 100644 --- a/broker/fastexact.go +++ b/broker/fastexact.go @@ -27,6 +27,9 @@ type FastExact struct { func NewFastExact() FastExact { fe := FastExact{} fe.doer = fe + if config.Get().Brokers.FastExact.Mock { + fe = fe.WithMock() + } return fe } diff --git a/broker/fastexact_test.go b/broker/fastexact_test.go index 0a26e7d..e67a2d0 100644 --- a/broker/fastexact_test.go +++ b/broker/fastexact_test.go @@ -3,6 +3,7 @@ package broker import ( "local/storage" "local/truckstop/config" + "local/truckstop/logtr" "os" "path" "testing" @@ -45,6 +46,7 @@ func TestFastExactReal(t *testing.T) { } func TestFastExactLogin(t *testing.T) { + logtr.SetLevel(logtr.SOS) limiter = rate.NewLimiter(rate.Limit(60.0), 1) fe := NewFastExact().WithMock() _ = fe @@ -55,6 +57,7 @@ func TestFastExactLogin(t *testing.T) { } func TestFastExactSearch(t *testing.T) { + logtr.SetLevel(logtr.SOS) limiter = rate.NewLimiter(rate.Limit(60.0), 1) fe := NewFastExact().WithMock() _ = fe