alpine_test: Fix an assertion in the case of invalid json

Signed-off-by: Simarpreet Singh <simar@linux.com>
This commit is contained in:
Simarpreet Singh 2019-10-08 09:27:53 -07:00
parent cb9538b720
commit 573a7b3b5a
No known key found for this signature in database
GPG Key ID: 029C2FCCD346A8AC

View File

@ -172,13 +172,12 @@ func TestShouldOverwrite(t *testing.T) {
}
})
// TODO: Why should this overwrite with invalid advisory json?
t.Run("invalid advisory json", func(t *testing.T) {
f, _ := ioutil.TempFile("", "TestShouldOverwrite_invalid_json")
_, _ = f.Write([]byte(`badjsonhere`))
defer f.Close()
assert.Equal(t, false, shouldOverwrite(f.Name(), "doesnt matter"), "invalid advisory json")
assert.Equal(t, true, shouldOverwrite(f.Name(), "doesnt matter"), "invalid advisory json")
})