test

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadDataFile = cafs.NewMemfileBytes("bad_csv_file.csv", []byte(`
asdlkfasd,,
fm as
f;lajsmf 
a
's;f a'
sdlfj asdf`))

BadDataFile is a bunch of bad CSV data

View Source
var BadDataFormatFile = cafs.NewMemfileBytes("abc.csv", []byte(`
"colA","colB","colC","colD"
1,2,3,4
1,2,3`))

BadDataFormatFile has weird line lengths

View Source
var BadStructureFile = cafs.NewMemfileBytes("badStructure.csv", []byte(`
colA, colB, colB, colC
1,2,3,4
1,2,3,4`))

BadStructureFile has double-named columns

View Source
var JobsByAutomationFile = cafs.NewMemfileBytes("jobs_ranked_by_automation_probability.csv", []byte(`rank,probability_of_automation,soc_code,job_title
702,"0.99","41-9041","Telemarketers"
701,"0.99","23-2093","Title Examiners, Abstractors, and Searchers"
700,"0.99","51-6051","Sewers, Hand"
699,"0.99","15-2091","Mathematical Technicians"
698,"0.99","13-2053","Insurance Underwriters"
697,"0.99","49-9064","Watch Repairers"
696,"0.99","43-5011","Cargo and Freight Agents"
695,"0.99","13-2082","Tax Preparers"
694,"0.99","51-9151","Photographic Process Workers and Processing Machine Operators"
693,"0.99","43-4141","New Accounts Clerks"
692,"0.99","25-4031","Library Technicians"
691,"0.99","43-9021","Data Entry Keyers"
690,"0.98","51-2093","Timing Device Assemblers and Adjusters"
689,"0.98","43-9041","Insurance Claims and Policy Processing Clerks"
688,"0.98","43-4011","Brokerage Clerks"
687,"0.98","43-4151","Order Clerks"
686,"0.98","13-2072","Loan Officers"
685,"0.98","13-1032","Insurance Appraisers, Auto Damage"
684,"0.98","27-2023","Umpires, Referees, and Other Sports Officials"
683,"0.98","43-3071","Tellers"
682,"0.98","51-9194","Etchers and Engravers"
681,"0.98","51-9111","Packaging and Filling Machine Operators and Tenders"
680,"0.98","43-3061","Procurement Clerks"
679,"0.98","43-5071","Shipping, Receiving, and Traffic Clerks"
678,"0.98","51-4035","Milling and Planing Machine Setters, Operators, and Tenders, Metal and Plastic"
677,"0.98","13-2041","Credit Analysts"
676,"0.98","41-2022","Parts Salespersons"
675,"0.98","13-1031","Claims Adjusters, Examiners, and Investigators"
674,"0.98","53-3031","Driver/Sales Workers"
673,"0.98","27-4013","Radio Operators"
`))

JobsByAutomationFile is real, valid data

Functions

func DatasetActions added in v0.3.0

func DatasetActions(t *testing.T, rmf RepoMakerFunc)

DatasetActions runs actions.Dataset tests against a given repo TODO - actions should only use public repo methods. remove this test in favor of a lower-level test suite

func NewMemRepoFromDir added in v0.3.0

func NewMemRepoFromDir(path string) (repo.Repo, crypto.PrivKey, error)

NewMemRepoFromDir reads a director of testCases and calls createDataset on each case with the given privatekey, yeilding a repo where the peer with this pk has created each dataset in question

func NewTestRepo

func NewTestRepo() (mr repo.Repo, err error)

NewTestRepo generates a repository usable for testing purposes

func ProfileConfig added in v0.3.0

func ProfileConfig() *config.Profile

ProfileConfig returns the test profile as a config.Profile

func ReadRepoConfig added in v0.3.0

func ReadRepoConfig(path string) (pro *profile.Profile, pk crypto.PrivKey, err error)

ReadRepoConfig loads configuration data from a .yaml file

func RunRepoTests

func RunRepoTests(t *testing.T, rmf RepoMakerFunc)

RunRepoTests tests that this repo conforms to expected behaviors

Types

type RepoMakerFunc added in v0.3.0

type RepoMakerFunc func(t *testing.T) repo.Repo

RepoMakerFunc produces a new instance of a repository when called

Jump to

Keyboard shortcuts

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