Documentation
¶
Overview ¶
Package data provides access to loading and saving CTS data.
Index ¶
- func Load(dir string, vars map[string]string) (Fixtures, TestSuites, error)
- func SaveFixture(fixture Fixture, file string) error
- func SaveFixtures(fixtures Fixtures, dir string) error
- func SaveTestSuite(ts TestSuite, file string, vars map[string]string) error
- func SaveTestSuites(tss TestSuites, dir string, vars map[string]string) error
- type Fixture
- type Fixtures
- type TestCase
- type TestSuite
- type TestSuites
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load parses JSON-encoded fixtures and test suites from the given directory (recursively).
func SaveFixture ¶
SaveFixture writes the JSON encoding of the fixture to the given file.
func SaveFixtures ¶
SaveFixtures writes the JSON encoding of fixtures to the given directory.
func SaveTestSuite ¶
SaveTestSuite writes the JSON encoding of the test suite to the given file.
func SaveTestSuites ¶
func SaveTestSuites(tss TestSuites, dir string, vars map[string]string) error
SaveTestSuites writes the JSON encoding of test suites to the given directory.
Types ¶
type Fixture ¶
Fixture represents a set of documents in a single collection.
func LoadFixture ¶
LoadFixture parses a JSON-encoded fixture from the given file.
type Fixtures ¶
Fixtures is an unordered set of collection names and their documents.
func LoadFixtures ¶
LoadFixtures parses JSON-encoded fixtures from the given directory.
type TestCase ¶
type TestCase struct { Request *wirebson.Document `json:"request"` Response *wirebson.Document `json:"response"` }
TestCase represents a single request / expected response pair.
type TestSuite ¶
TestSuite is an ordered set of named test cases. They are sorted by their names. Test cases may depend on previous ones.
type TestSuites ¶
TestSuites is an unordered set of named suites. They should be independent from each other.
func LoadTestSuites ¶
func LoadTestSuites(dir string, vars map[string]string) (TestSuites, error)
LoadTestSuites parses JSON-encoded test suites from the given directory (recursively).