Documentation
¶
Overview ¶
Package test provides common functions for testing.
Index ¶
- Variables
- func Certificate(t *testing.T) *xmldsig.Certificate
- func LoadEnvelope(file string) *gobl.Envelope
- func LoadInvoice(name string) (*gobl.Envelope, *bill.Invoice)
- func LoadSchema(name string) (*xsd.Schema, error)
- func LoadStatus(name string) (*gobl.Envelope, *bill.Status)
- func Path(elements ...string) string
- func RootPath() string
- func ValidateXML(schema *xsd.Schema, doc []byte) []error
Constants ¶
This section is empty.
Variables ¶
View Source
var UpdateOut = flag.Bool("update", false, "Update the example files in test/data and test/data/out")
UpdateOut is a flag that can be set to update example files
Functions ¶
func Certificate ¶ added in v0.32.0
func Certificate(t *testing.T) *xmldsig.Certificate
Certificate loads the persisted test certificate from test/certs/test.p12.
func LoadEnvelope ¶
LoadEnvelope loads a test file from the test/data folder as a GOBL envelope and will rebuild it if necessary to ensure any changes are accounted for.
func LoadInvoice ¶
LoadInvoice will load the GOBL Envelope and extract the invoice, returning both the Envelope and Invoice objects.
func LoadSchema ¶ added in v0.32.0
LoadSchema loads an XSD schema from the test/schema directory
func LoadStatus ¶ added in v0.32.0
LoadStatus will load the GOBL Envelope and extract the status, returning both the Envelope and Status objects.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.