Exemplo n.º 1
0
func (l Login) saveOrg(config *configuration.Configuration, org cf.Organization) (err error) {
	config.Organization = org
	err = l.configRepo.Save()

	if err != nil {
		l.ui.Failed("Error saving organization: %s", err)
		return
	}

	return
}
Exemplo n.º 2
0
func callShowSpace(t *testing.T, args []string, reqFactory *testreq.FakeReqFactory, config *configuration.Configuration) (ui *testterm.FakeUI) {
	ui = new(testterm.FakeUI)
	ctxt := testcmd.NewContext("space", args)

	token, err := testconfig.CreateAccessTokenWithTokenInfo(configuration.TokenInfo{
		Username: "******",
	})
	assert.NoError(t, err)

	config.Organization = cf.Organization{Name: "my-org"}
	config.AccessToken = token

	cmd := NewShowSpace(ui, config)
	testcmd.RunCommand(cmd, ctxt, reqFactory)
	return
}