testutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Data = []DFileData{
	{
		[]byte{50, 51, 52},
		storage.DFile{
			Prefix:  "",
			Postfix: "",
			Time:    time.Date(2000, 1, 2, 3, 4, 5, 0, time.UTC),
			Hash:    storage.CalculateHash([]byte{50, 51, 52}),
		},
		hour.Date(2000, 1, 2, 3),
	},
	{
		[]byte{60, 61, 62},
		storage.DFile{
			Prefix:  "",
			Postfix: "",
			Time:    time.Date(2000, 1, 2, 3, 5, 5, 0, time.UTC),
			Hash:    storage.CalculateHash([]byte{60, 61, 62}),
		},
		hour.Date(2000, 1, 2, 3),
	},
	{
		[]byte{60, 61, 62},
		storage.DFile{
			Prefix:  "",
			Postfix: "",
			Time:    time.Date(2000, 1, 2, 3, 6, 10, 0, time.UTC),
			Hash:    storage.CalculateHash([]byte{60, 61, 62}),
		},
		hour.Date(2000, 1, 2, 3),
	},
	{
		[]byte{70, 71, 72},
		storage.DFile{
			Prefix:  "",
			Postfix: "",
			Time:    time.Date(2000, 1, 2, 3, 6, 15, 0, time.UTC),
			Hash:    storage.CalculateHash([]byte{70, 71, 72}),
		},
		hour.Date(2000, 1, 2, 3),
	},
}

Functions

func CompareBytes

func CompareBytes(b1, b2 []byte) bool

func CreateArchiveFromData

func CreateArchiveFromData(t *testing.T, f *config.Feed, aStore storage.AStore, dFileData ...DFileData) storage.AFile

func DStoreHasDFile

func DStoreHasDFile(dStore storage.ReadableDStore, dFile storage.DFile, expectedContent []byte) error

TODO: Expect and use DFileData

func ErrorOrFail

func ErrorOrFail(t *testing.T, err error)

TODO: rename TODO: accept a string describing the error

func ExpectDStoreHasExactlyDFiles

func ExpectDStoreHasExactlyDFiles(t *testing.T, dStore storage.ReadableDStore, dFiles ...DFileData)

Types

type DFileData

type DFileData struct {
	Content []byte
	DFile   storage.DFile
	Hour    hour.Hour
}

Jump to

Keyboard shortcuts

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