github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/payload/status/formatter_test.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package status_test 5 6 import ( 7 "github.com/juju/testing" 8 jc "github.com/juju/testing/checkers" 9 gc "gopkg.in/check.v1" 10 11 "github.com/juju/juju/payload/status" 12 ) 13 14 var _ = gc.Suite(&formatterSuite{}) 15 16 type formatterSuite struct { 17 testing.IsolationSuite 18 } 19 20 func (s *formatterSuite) TestFormatPayloadOkay(c *gc.C) { 21 payload := status.NewPayload("spam", "a-service", 1, 0) 22 payload.Labels = []string{"a-tag"} 23 formatted := status.FormatPayload(payload) 24 25 c.Check(formatted, jc.DeepEquals, status.FormattedPayload{ 26 Unit: "a-service/0", 27 Machine: "1", 28 ID: "idspam", 29 Type: "docker", 30 Class: "spam", 31 Labels: []string{"a-tag"}, 32 Status: "running", 33 }) 34 }