argumentstest

package
v0.0.0-...-bcf1048 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJSON

func ParseJSON(t *testing.T, data []byte) arguments.Argument

ParseJSON unmarshals JSON data as an Argument.

func ParseSample

func ParseSample(t *testing.T, unixPath string) arguments.Argument

ParseSample parses the JSON from the file at unixPath and returns it as an Argument.

func ReadFile

func ReadFile(t *testing.T, unixPath string) []byte

ReadFile reads the JSON data from unixPath.

Types

type StoreTests

type StoreTests struct {
	suite.Suite
	StoreFactory func() endpoints.Store
}

StoreTests is a testing suite which makes sure that a Store obeys the interface contract

func (*StoreTests) TestDeletedIsUnavailable

func (suite *StoreTests) TestDeletedIsUnavailable()

TestDeletedIsUnavailable makes sure the backend doesn't return arguments that have been deleted.

func (*StoreTests) TestDeletedUnknownReturnsNotFound

func (suite *StoreTests) TestDeletedUnknownReturnsNotFound()

TestDeletedUnknownReturnsNotFound makes sure the backend returns a NotFoundError if asked to delete an unknown entry.

func (*StoreTests) TestFetchAllChangedConclusion

func (suite *StoreTests) TestFetchAllChangedConclusion()

TestFetchAllChangedConclusion makes sure the store finds live versions which have a different conclusion from when they started.

func (*StoreTests) TestFetchByConclusion

func (suite *StoreTests) TestFetchByConclusion()

TestFetchByConclusion makes sure the Store returns all the arguments for a conclusion.

func (*StoreTests) TestFetchOne

func (suite *StoreTests) TestFetchOne()

TestFetchOne makes sure the Store limits how many objects it returns properly.

func (*StoreTests) TestFetchUnknownReturnsError

func (suite *StoreTests) TestFetchUnknownReturnsError()

TestFetchUnknownReturnsError makes sure the backend returns errors when asked for an unknown ID.

func (*StoreTests) TestFetchWithConclusionSearch

func (suite *StoreTests) TestFetchWithConclusionSearch()

TestFetchWithConclusionSearch makes sure the Store limits what it returns based on which words the user expects the conclusion to have.

func (*StoreTests) TestFetchWithExclusions

func (suite *StoreTests) TestFetchWithExclusions()

TestFetchWithExclusions makes sure the Store excludes arguments properly.

func (*StoreTests) TestFetchWithOffset

func (suite *StoreTests) TestFetchWithOffset()

TestFetchWithOffset makes sure the Store skips elements properly when given an offset.

func (*StoreTests) TestOriginalIsAvailable

func (suite *StoreTests) TestOriginalIsAvailable()

TestOriginalIsAvailable makes sure that old versions of updated arguments can still be fetched.

func (*StoreTests) TestSaveIsLive

func (suite *StoreTests) TestSaveIsLive()

TestSaveIsLive makes sure that an argument is "live" immediately after being saved.

func (*StoreTests) TestUpdateUnknownReturnsError

func (suite *StoreTests) TestUpdateUnknownReturnsError()

TestUpdateUnknownReturnsError makes sure that we can't update arguments which don't exist.

func (*StoreTests) TestUpdatedIsLive

func (suite *StoreTests) TestUpdatedIsLive()

TestUpdatedIsLive makes sure that a newly updated argument uses the latest premises.

func (*StoreTests) TestVersionedFetchAll

func (suite *StoreTests) TestVersionedFetchAll()

TestVersionedFetchAll makes sure the Store returns the argument's live version only.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL