Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 3ef5583

Browse files
committed
Unit test composeFileFromScratch
Signed-off-by: Joffrey F <[email protected]>
1 parent 4098f12 commit 3ef5583

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

packager/init_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package packager
2+
3+
import (
4+
"github.com/gotestyourself/gotestyourself/assert"
5+
"testing"
6+
7+
"gopkg.in/yaml.v2"
8+
9+
"github.com/docker/lunchbox/types"
10+
)
11+
12+
func TestComposeFileFromScratch(t *testing.T) {
13+
services := []string{
14+
"redis", "mysql", "python",
15+
}
16+
17+
result, err := composeFileFromScratch(services)
18+
assert.NilError(t, err)
19+
20+
expected := types.NewInitialComposeFile()
21+
expected.Services = &map[string]types.InitialService{
22+
"redis": {Image: "redis"},
23+
"mysql": {Image: "mysql"},
24+
"python": {Image: "python"},
25+
}
26+
expectedBytes, err := yaml.Marshal(expected)
27+
assert.NilError(t, err)
28+
assert.DeepEqual(t, result, expectedBytes)
29+
}

0 commit comments

Comments
 (0)