Exemplo n.º 1
0
func (s *apiSuite) SetUpTest(c *gc.C) {
	s.httpClient = &mockHttpClient{}
	var err error
	s.client, err = terms.NewClient(terms.HTTPClient(s.httpClient))
	c.Assert(err, jc.ErrorIsNil)
}
Exemplo n.º 2
0
import (
	"encoding/json"

	"github.com/juju/cmd"
	"github.com/juju/errors"
	"github.com/juju/juju/cmd/modelcmd"
	"gopkg.in/macaroon-bakery.v1/httpbakery"
	"launchpad.net/gnuflag"

	"github.com/juju/romulus/api/terms"
)

var (
	newClient = func(client *httpbakery.Client) (TermsServiceClient, error) {
		return terms.NewClient(terms.HTTPClient(client))
	}
)

// TermsServiceClient defines methods needed for the Terms Service CLI
// commands.
type TermsServiceClient interface {
	GetUsersAgreements() ([]terms.AgreementResponse, error)
}

const listAgreementsDoc = `
List terms the user has agreed to.
`

// NewListAgreementsCommand returns a new command that can be
// used to list agreements a user has made.