Documentation
¶
Overview ¶
Package sourcetest is the conformance suite every collector must pass. The three extension tiers (Go, YAML template, external process) are only safe if "is a source" means the same thing for all of them, so the properties that definition rests on are asserted here once rather than per provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Case ¶
type Case struct {
New func(base string) source.Source
Root string
// Pages are served one per request, in order. More than one page asserts
// that the source follows pagination to the end.
Pages []string
// Want is every hostname the source should emit across all pages.
Want []string
// ContentType of the served pages.
ContentType string
}
Case describes one source under test. New receives the base URL of a test server and must return a source that talks to it instead of the real provider, which is the only concession a source makes to being testable.
Click to show internal directories.
Click to hide internal directories.