Documentation
¶
Index ¶
- func Assert(tb testing.TB, condition bool, msg string, v ...interface{})
- func Equals(tb testing.TB, exp, act interface{})
- func ExpectMetricCount(t *testing.T, c prometheus.Collector, expected int, expectedMetrics ...string)
- func ExpectMetrics(t *testing.T, c prometheus.Collector, fixture string, ...)
- func GetFixturePath(fixture string) string
- func NewCollectorTestDb() (string, map[string]*data.WatchItem)
- func NewTestItem(title string, price float64, currency string, checkCount int, ...) (string, *data.WatchItem)
- func NewWatchDb(numItems int) map[string]*data.WatchItem
- func Ok(tb testing.TB, err error)
- type ApiTestServer
- type ApiTestServerOption
- type ApiTestServerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectMetricCount ¶ added in v0.1.0
func ExpectMetrics ¶ added in v0.1.0
func GetFixturePath ¶
func NewCollectorTestDb ¶ added in v0.1.0
createCollectorTestDb creates a test database with two watch items and returns the UUID of the second item and the database.
func NewTestItem ¶
Types ¶
type ApiTestServer ¶
type ApiTestServer struct { Server *httptest.Server Options ApiTestServerOptions // contains filtered or unexported fields }
func CreateTestApiServer ¶
func CreateTestApiServer(t *testing.T, watches map[string]*data.WatchItem, options ...ApiTestServerOption) *ApiTestServer
func (*ApiTestServer) Close ¶
func (s *ApiTestServer) Close()
func (*ApiTestServer) URL ¶
func (s *ApiTestServer) URL() string
type ApiTestServerOption ¶ added in v0.1.0
type ApiTestServerOption func(*ApiTestServerOptions)
func WithPricesAsArray ¶ added in v0.1.0
func WithPricesAsArray() ApiTestServerOption
func WithSystemInfo ¶ added in v0.1.0
func WithSystemInfo(info *data.SystemInfo) ApiTestServerOption
type ApiTestServerOptions ¶ added in v0.1.0
type ApiTestServerOptions struct { fmt.Stringer PricesAsArray bool SystemInfo *data.SystemInfo }
func (ApiTestServerOptions) String ¶ added in v0.1.0
func (o ApiTestServerOptions) String() string
Click to show internal directories.
Click to hide internal directories.