Restructure tests

This commit is contained in:
2023-05-04 07:00:30 +02:00
parent ebba4371eb
commit 27894ea0a9
7 changed files with 28 additions and 473 deletions

View File

@@ -34,7 +34,7 @@ func copyFile(s string, d string) error {
return nil
}
func setupRepo(t *testing.T) *repository.JobRepository {
func setup(t *testing.T) *repository.JobRepository {
const testconfig = `{
"addr": "0.0.0.0:8080",
"validate": false,
@@ -138,7 +138,7 @@ func readResult(t *testing.T, testname string) Result {
}
func TestHandleImportFlag(t *testing.T) {
r := setupRepo(t)
r := setup(t)
tests, err := filepath.Glob(filepath.Join("testdata", "*.input"))
if err != nil {
@@ -167,7 +167,6 @@ func TestHandleImportFlag(t *testing.T) {
if job.Duration != result.Duration {
t.Errorf("wrong duration for job\ngot: %d \nwant: %d", job.Duration, result.Duration)
}
})
}
}