コード例 #1
0
ファイル: test_basic.go プロジェクト: johan--/flynn
	appDir string
}

func (s *appSuite) Flynn(args ...string) *CmdResult {
	return flynn(s.appDir, args...)
}

func (s *appSuite) Git(args ...string) *CmdResult {
	return git(s.appDir, args...)
}

type BasicSuite struct {
	appSuite
}

var _ = c.Suite(&BasicSuite{})

func (s *BasicSuite) SetUpSuite(t *c.C) {
	s.appDir = initApp(t, "basic")
}

var Attempts = attempt.Strategy{
	Min:   5,
	Total: 10 * time.Second,
	Delay: 500 * time.Millisecond,
}

func (s *BasicSuite) TestBasic(t *c.C) {
	name := random.String(30)
	t.Assert(s.Flynn("create", name), Outputs, fmt.Sprintf("Created %s\n", name))
コード例 #2
0
ファイル: test_scheduler.go プロジェクト: snormore/flynn
import (
	"encoding/base64"
	"time"

	c "github.com/flynn/flynn/Godeps/_workspace/src/gopkg.in/check.v1"
	"github.com/flynn/flynn/cli/config"
	"github.com/flynn/flynn/controller/client"
	ct "github.com/flynn/flynn/controller/types"
)

type SchedulerSuite struct {
	client *controller.Client
}

var _ = c.Suite(&SchedulerSuite{})

func (s *SchedulerSuite) SetUpSuite(t *c.C) {
	conf, err := config.ReadFile(flynnrc)
	t.Assert(err, c.IsNil)

	cluster := conf.Clusters[0]
	pin, err := base64.StdEncoding.DecodeString(cluster.TLSPin)
	t.Assert(err, c.IsNil)
	client, err := controller.NewClientWithPin(cluster.URL, cluster.Key, pin)
	t.Assert(err, c.IsNil)

	s.client = client
}

func processesEqual(expected, actual map[string]int) bool {