Skip to content

Commit 673fc37

Browse files
committed
analyzer_test: Reduce cruft.
Signed-off-by: Simarpreet Singh <[email protected]>
1 parent 511e061 commit 673fc37

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

analyzer/analyzer_test.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (m mockOSAnalyzer) Analyze(extractor.FileMap) (OS, error) {
4949
}
5050

5151
func (m mockOSAnalyzer) RequiredFiles() []string {
52-
return []string{"file1", "file2", "file3"}
52+
return []string{"file1", "file2"}
5353
}
5454

5555
func TestAnalyze(t *testing.T) {
@@ -64,17 +64,15 @@ func TestAnalyze(t *testing.T) {
6464
{
6565
name: "happy path with docker installed and image found",
6666
extractFromFileFunc: func(ctx context.Context, r io.Reader, filenames []string) (maps extractor.FileMap, e error) {
67-
assert.Equal(t, []string{"file1", "file2", "file3"}, filenames)
67+
assert.Equal(t, []string{"file1", "file2"}, filenames)
6868
return extractor.FileMap{
6969
"file1": []byte{0x1, 0x2, 0x3},
70-
"file2": []byte{0x1, 0x2, 0x3},
71-
"file3": []byte{0x1, 0x2, 0x3},
70+
"file2": []byte{0x4, 0x5, 0x6},
7271
}, nil
7372
},
7473
expectedFileMap: extractor.FileMap{
7574
"file1": []byte{0x1, 0x2, 0x3},
76-
"file2": []byte{0x1, 0x2, 0x3},
77-
"file3": []byte{0x1, 0x2, 0x3},
75+
"file2": []byte{0x4, 0x5, 0x6},
7876
},
7977
},
8078
{
@@ -84,17 +82,15 @@ func TestAnalyze(t *testing.T) {
8482
},
8583
extractFunc: func(ctx context.Context, imageName string, filenames []string) (maps extractor.FileMap, e error) {
8684
assert.Equal(t, "fooimage", imageName)
87-
assert.Equal(t, []string{"file1", "file2", "file3"}, filenames)
85+
assert.Equal(t, []string{"file1", "file2"}, filenames)
8886
return extractor.FileMap{
8987
"file1": []byte{0x1, 0x2, 0x3},
90-
"file2": []byte{0x1, 0x2, 0x3},
91-
"file3": []byte{0x1, 0x2, 0x3},
88+
"file2": []byte{0x4, 0x5, 0x6},
9289
}, nil
9390
},
9491
expectedFileMap: extractor.FileMap{
9592
"file1": []byte{0x1, 0x2, 0x3},
96-
"file2": []byte{0x1, 0x2, 0x3},
97-
"file3": []byte{0x1, 0x2, 0x3},
93+
"file2": []byte{0x4, 0x5, 0x6},
9894
},
9995
},
10096
}

0 commit comments

Comments
 (0)