tests: test for blueprint.GetPackages()
This also tests Package with "*" specified as version
This commit is contained in:
parent
4c39223497
commit
833e798f1b
1 changed files with 18 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package blueprint
|
|||
|
||||
import (
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
|
@ -89,3 +90,20 @@ func TestBumpVersion(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetPackages(t *testing.T) {
|
||||
|
||||
bp := Blueprint{
|
||||
Name: "packages-test",
|
||||
Description: "Testing GetPackages function",
|
||||
Version: "0.0.1",
|
||||
Packages: []Package{
|
||||
{Name: "tmux", Version: "1.2"}},
|
||||
Modules: []Package{
|
||||
{Name: "openssh-server", Version: "*"}},
|
||||
Groups: []Group{
|
||||
{Name: "anaconda-tools"}},
|
||||
}
|
||||
Received_packages := bp.GetPackages()
|
||||
assert.ElementsMatch(t, []string{"tmux-1.2", "openssh-server", "@anaconda-tools"}, Received_packages)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue