Skip to content

Commit

Permalink
refator: add test coverage for TestReadBOSHReleaseManifestsFromTarballs
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr committed Jul 5, 2023
1 parent 97af195 commit ee11778
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/tile/bosh_release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tile_test

import (
"bytes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"io"
"os"
Expand Down Expand Up @@ -33,6 +34,16 @@ func TestReadReleaseFromFile(t *testing.T) {
please.Expect(err).NotTo(HaveOccurred())
}

func TestReadBOSHReleaseManifestsFromTarballs(t *testing.T) {
boshReleases, err := tile.ReadBOSHReleaseManifestsFromTarballs(os.DirFS("testdata"), "bpm-1.1.21-ubuntu-xenial-621.463.tgz", "bpm-1.1.21.tgz")
require.NoError(t, err)
require.Len(t, boshReleases, 2)
assert.Equal(t, "be5b1710f33128f6c864eae1d97effddb94dd3ac", boshReleases[0].SHA1)
assert.Equal(t, "519b78f2f3333a7b9c000bbef325e12a2f36996d", boshReleases[1].SHA1)
assert.Equal(t, "bpm-1.1.21-ubuntu-xenial-621.463.tgz", boshReleases[0].FilePath)
assert.Equal(t, "bpm-1.1.21.tgz", boshReleases[1].FilePath)
}

func TestReadProductTemplatePartFromBOSHReleaseTarball(t *testing.T) {
t.Run("when the release is compiled", func(t *testing.T) {
f, err := os.Open(filepath.Join("testdata", "bpm-1.1.21-ubuntu-xenial-621.463.tgz"))
Expand Down

0 comments on commit ee11778

Please sign in to comment.