本文整理汇总了Golang中gopkg/in/check/v1.Suite函数的典型用法代码示例。如果您正苦于以下问题:Golang Suite函数的具体用法?Golang Suite怎么用?Golang Suite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Suite函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
check.Suite(&SimpleSuite{})
check.Suite(&FileSuite{})
check.Suite(&DockerSuite{})
check.Suite(&ConsulSuite{})
check.Suite(&MarathonSuite{})
}
示例2: registerLocalTests
func registerLocalTests() {
// N.B. Make sure the region we use here
// has entries in the images/query txt files.
aws.Regions["test"] = aws.Region{
Name: "test",
}
gc.Suite(&localServerSuite{})
gc.Suite(&localLiveSuite{})
gc.Suite(&localNonUSEastSuite{})
}
示例3: init
func init() {
gc.Suite(&liveSuite{
LiveTests: jujutest.LiveTests{
TestConfig: dummy.SampleConfig(),
CanOpenState: true,
HasProvisioner: false,
},
})
gc.Suite(&suite{
Tests: jujutest.Tests{
TestConfig: dummy.SampleConfig(),
},
})
}
示例4: registerAmazonTests
func registerAmazonTests() {
// The following attributes hold the environment configuration
// for running the amazon EC2 integration tests.
//
// This is missing keys for security reasons; set the following
// environment variables to make the Amazon testing work:
// access-key: $AWS_ACCESS_KEY_ID
// secret-key: $AWS_SECRET_ACCESS_KEY
attrs := coretesting.FakeConfig().Merge(map[string]interface{}{
"name": "sample-" + uniqueName,
"type": "ec2",
"control-bucket": "juju-test-" + uniqueName,
"admin-secret": "for real",
"firewall-mode": config.FwInstance,
"agent-version": coretesting.FakeVersionNumber.String(),
})
gc.Suite(&LiveTests{
LiveTests: jujutest.LiveTests{
TestConfig: attrs,
Attempt: *ec2.ShortAttempt,
CanOpenState: true,
HasProvisioner: true,
},
})
}
示例5: RegisterSuite
// RegisterSuite registers a new suite for a provided box
func RegisterSuite(boxConstructor BoxConstructor, opts isolate.Profile, skipCheck SkipCheck) {
check.Suite(&BoxSuite{
Constructor: boxConstructor,
SkipCheck: skipCheck,
opts: opts,
ctx: context.Background(),
})
}
示例6: registerLiveSimpleStreamsTests
func registerLiveSimpleStreamsTests(baseURL string, validImageConstraint simplestreams.LookupConstraint, requireSigned bool) {
gc.Suite(&sstesting.LocalLiveSimplestreamsSuite{
Source: simplestreams.NewURLDataSource("test", baseURL, utils.VerifySSLHostnames, simplestreams.DEFAULT_CLOUD_DATA, requireSigned),
RequireSigned: requireSigned,
DataType: imagemetadata.ImageIds,
ValidConstraint: validImageConstraint,
})
}
示例7: init
func init() {
check.Suite(&SimpleSuite{})
check.Suite(&HTTPSSuite{})
check.Suite(&FileSuite{})
check.Suite(&DockerSuite{})
check.Suite(&ConsulSuite{})
check.Suite(&ConsulCatalogSuite{})
check.Suite(&EtcdSuite{})
check.Suite(&MarathonSuite{})
}
示例8: registerLiveSimpleStreamsTests
func registerLiveSimpleStreamsTests(baseURL string, validToolsConstraint simplestreams.LookupConstraint, requireSigned bool) {
gc.Suite(&sstesting.LocalLiveSimplestreamsSuite{
Source: simplestreams.NewURLDataSource("test", baseURL, utils.VerifySSLHostnames, simplestreams.DEFAULT_CLOUD_DATA, requireSigned),
RequireSigned: requireSigned,
DataType: tools.ContentDownload,
StreamsVersion: tools.CurrentStreamsVersion,
ValidConstraint: validToolsConstraint,
})
}
示例9: registerSimpleStreamsTests
func registerSimpleStreamsTests() {
gc.Suite(&simplestreamsSuite{
LocalLiveSimplestreamsSuite: sstesting.LocalLiveSimplestreamsSuite{
Source: simplestreams.NewURLDataSource(
"test roundtripper", "test:", utils.VerifySSLHostnames, simplestreams.DEFAULT_CLOUD_DATA, false),
RequireSigned: false,
DataType: imagemetadata.ImageIds,
StreamsVersion: imagemetadata.CurrentStreamsVersion,
ValidConstraint: imagemetadata.NewImageConstraint(simplestreams.LookupParams{
CloudSpec: simplestreams.CloudSpec{
Region: "us-east-1",
Endpoint: "https://ec2.us-east-1.amazonaws.com",
},
Series: []string{"precise"},
Arches: []string{"amd64", "arm"},
}),
},
})
gc.Suite(&signedSuite{})
}
示例10: registerSimpleStreamsTests
func registerSimpleStreamsTests() {
gc.Suite(&simplestreamsSuite{
LocalLiveSimplestreamsSuite: sstesting.LocalLiveSimplestreamsSuite{
Source: simplestreams.NewURLDataSource("test", "test:", utils.VerifySSLHostnames, simplestreams.DEFAULT_CLOUD_DATA, false),
RequireSigned: false,
DataType: tools.ContentDownload,
StreamsVersion: tools.CurrentStreamsVersion,
ValidConstraint: tools.NewVersionedToolsConstraint(version.MustParse("1.13.0"), simplestreams.LookupParams{
CloudSpec: simplestreams.CloudSpec{
Region: "us-east-1",
Endpoint: "https://ec2.us-east-1.amazonaws.com",
},
Series: []string{"precise"},
Arches: []string{"amd64", "arm"},
Stream: "released",
}),
},
})
gc.Suite(&signedSuite{})
}
示例11: registerLiveTests
// Register tests to run against a real Openstack instance.
func registerLiveTests(cred *identity.Credentials) {
config := makeTestConfig(cred)
gc.Suite(&LiveTests{
cred: cred,
LiveTests: jujutest.LiveTests{
TestConfig: config,
Attempt: *openstack.ShortAttempt,
CanOpenState: true,
HasProvisioner: true,
},
})
}
示例12: init
func init() {
flag.Parse()
if *runFeatureTests == false {
return
}
// Initialize all suites here.
gc.Suite(&cmdJujuSuite{})
gc.Suite(&leadershipSuite{})
gc.Suite(&uniterLeadershipSuite{})
gc.Suite(&annotationsSuite{})
gc.Suite(&apiEnvironmentSuite{})
gc.Suite(&blockSuite{})
gc.Suite(&apiCharmsSuite{})
gc.Suite(&cmdEnvironmentSuite{})
gc.Suite(&cmdStorageSuite{})
}
示例13: registerSimpleStreamsTests
func registerSimpleStreamsTests() {
gc.Suite(&simplestreamsSuite{
LocalLiveSimplestreamsSuite: sstesting.LocalLiveSimplestreamsSuite{
Source: simplestreams.NewURLDataSource("test", "test:", utils.VerifySSLHostnames),
RequireSigned: false,
DataType: "image-ids",
StreamsVersion: "v1",
ValidConstraint: sstesting.NewTestConstraint(simplestreams.LookupParams{
CloudSpec: simplestreams.CloudSpec{
Region: "us-east-1",
Endpoint: "https://ec2.us-east-1.amazonaws.com",
},
Series: []string{"precise"},
Arches: []string{"amd64", "arm"},
}),
},
})
}
示例14: SetUpSuite
"github.com/juju/juju/cloudconfig/instancecfg"
"github.com/juju/juju/constraints"
"github.com/juju/juju/environs"
"github.com/juju/juju/environs/imagemetadata"
"github.com/juju/juju/instance"
"github.com/juju/juju/testing"
"github.com/juju/juju/tools"
"github.com/juju/juju/version"
)
type clientSuite struct {
testing.BaseSuite
}
var _ = gc.Suite(&clientSuite{})
func (s *clientSuite) SetUpSuite(c *gc.C) {
s.BaseSuite.SetUpSuite(c)
mock.Start()
}
func (s *clientSuite) TearDownSuite(c *gc.C) {
mock.Stop()
s.BaseSuite.TearDownSuite(c)
}
func (s *clientSuite) SetUpTest(c *gc.C) {
s.BaseSuite.SetUpTest(c)
ll := logger.LogLevel()
示例15: TestInputs
"fmt"
"time"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
)
type SelfSuite struct {
engineFixture
}
var _ = gc.Suite(&SelfSuite{})
func (s *SelfSuite) TestInputs(c *gc.C) {
manifold := dependency.SelfManifold(s.engine)
c.Check(manifold.Inputs, gc.HasLen, 0)
}
func (s *SelfSuite) TestStart(c *gc.C) {
manifold := dependency.SelfManifold(s.engine)
engine, err := manifold.Start(nil)
c.Check(err, jc.ErrorIsNil)
c.Check(engine, gc.Equals, s.engine)
}
func (s *SelfSuite) TestOutputBadInput(c *gc.C) {
manifold := dependency.SelfManifold(s.engine)