From a978266adf460065d8a1cae438fba0bb95f3ec55 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Tue, 8 Oct 2019 09:41:10 -0400 Subject: [PATCH] rm deplicate test helper --- .../docker/image_archive_analysis_test.go | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/dive/image/docker/image_archive_analysis_test.go b/dive/image/docker/image_archive_analysis_test.go index 5d9aacc..afc3825 100644 --- a/dive/image/docker/image_archive_analysis_test.go +++ b/dive/image/docker/image_archive_analysis_test.go @@ -1,28 +1,9 @@ package docker import ( - "github.com/wagoodman/dive/dive/image" "testing" ) -func analysisFromImageTar(t *testing.T, path string) *image.AnalysisResult { - archive, err := TestLoadArchive(path) - if err != nil { - t.Fatalf("unable to fetch archive: %v", err) - } - - img, err := archive.ToImage() - if err != nil { - t.Fatalf("unable to convert to image: %v", err) - } - - result, err := img.Analyze() - if err != nil { - t.Fatalf("unable to analyze: %v", err) - } - return result -} - func Test_Analysis(t *testing.T) { table := map[string]struct { @@ -37,7 +18,7 @@ func Test_Analysis(t *testing.T) { } for name, test := range table { - result := analysisFromImageTar(t, test.path) + result := TestAnalysisFromArchive(t, test.path) if result.SizeBytes != test.sizeBytes { t.Errorf("%s.%s: expected sizeBytes=%v, got %v", t.Name(), name, test.sizeBytes, result.SizeBytes) @@ -59,5 +40,4 @@ func Test_Analysis(t *testing.T) { t.Errorf("%s.%s: expected efficiency=%v, got %v", t.Name(), name, test.efficiency, result.Efficiency) } } - }