예제 #1
0
func TestManifestGet(t *testing.T) {
	out := &bytes.Buffer{}
	smg := &SousManifestGet{
		TargetManifestID: graph.TargetManifestID{
			Source: sous.SourceLocation{
				Repo: project1.Repo,
			},
		},
		State:     makeTestState(),
		OutWriter: graph.OutWriter(out),
	}
	res := smg.Execute([]string{})
	assert.Equal(t, 0, res.ExitCode())

	assert.Regexp(t, "github", out.String())
}
예제 #2
0
func runCommand(t *testing.T, args []string, dff config.DeployFilterFlags) string {
	out := &bytes.Buffer{}
	state := makeTestState()
	shc := sous.SourceHostChooser{}
	rf, err := dff.BuildFilter(shc.ParseSourceLocation)
	require.NoError(t, err)
	deps, err := state.Deployments()
	require.NoError(t, err)
	smg := SousMetadataGet{
		DeployFilterFlags: dff,
		ResolveFilter:     rf,
		State:             state,
		CurrentGDM:        graph.CurrentGDM{Deployments: deps},
		OutWriter:         graph.OutWriter(out),
	}

	res := smg.Execute(args)
	assert.Equal(t, 0, res.ExitCode())

	return out.String()
}