本文整理汇总了Golang中github.com/tsuru/tsuru/provision/provisiontest.ExtensibleFakeProvisioner类的典型用法代码示例。如果您正苦于以下问题:Golang ExtensibleFakeProvisioner类的具体用法?Golang ExtensibleFakeProvisioner怎么用?Golang ExtensibleFakeProvisioner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ExtensibleFakeProvisioner类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: TestPlatformRemoveAlwaysRemoveFromDB
func (s *PlatformSuite) TestPlatformRemoveAlwaysRemoveFromDB(c *check.C) {
provisioner := provisiontest.ExtensibleFakeProvisioner{
FakeProvisioner: provisiontest.NewFakeProvisioner(),
}
Provisioner = &provisioner
defer func() {
Provisioner = s.provisioner
}()
conn, err := db.Conn()
c.Assert(err, check.IsNil)
defer conn.Close()
err = PlatformRemove("platform_dont_exists")
c.Assert(err, check.NotNil)
name := "test_platform_update"
args := make(map[string]string)
args["dockerfile"] = "http://localhost/Dockerfile"
err = PlatformAdd(provision.PlatformOptions{Name: name})
c.Assert(err, check.IsNil)
provisioner.PlatformRemove(name)
defer conn.Platforms().Remove(bson.M{"_id": name})
err = PlatformRemove(name)
c.Assert(err, check.IsNil)
count, err := conn.Platforms().Find(bson.M{"_id": name}).Count()
c.Assert(err, check.IsNil)
c.Assert(count, check.Equals, 0)
}
开发者ID:pedrosnk,项目名称:tsuru,代码行数:26,代码来源:platform_test.go
示例2: TestPlatformAddDuplicate
func (s *PlatformSuite) TestPlatformAddDuplicate(c *check.C) {
provisioner := provisiontest.ExtensibleFakeProvisioner{
FakeProvisioner: provisiontest.NewFakeProvisioner(),
}
Provisioner = &provisioner
defer func() {
Provisioner = s.provisioner
}()
conn, err := db.Conn()
c.Assert(err, check.IsNil)
defer conn.Close()
name := "test_platform_add"
args := make(map[string]string)
args["dockerfile"] = "http://localhost/Dockerfile"
err = PlatformAdd(provision.PlatformOptions{Name: name, Args: args})
defer conn.Platforms().Remove(bson.M{"_id": name})
c.Assert(err, check.IsNil)
provisioner.PlatformRemove(name)
err = PlatformAdd(provision.PlatformOptions{Name: name, Args: args})
c.Assert(err, check.Equals, DuplicatePlatformError)
}
开发者ID:pedrosnk,项目名称:tsuru,代码行数:21,代码来源:platform_test.go
示例3: TestPlatformAddWithProvisionerError
func (s *PlatformSuite) TestPlatformAddWithProvisionerError(c *check.C) {
provisioner := provisiontest.ExtensibleFakeProvisioner{
FakeProvisioner: provisiontest.NewFakeProvisioner(),
}
provisioner.PrepareFailure("PlatformAdd", errors.New("build error"))
Provisioner = &provisioner
defer func() {
Provisioner = s.provisioner
}()
conn, err := db.Conn()
c.Assert(err, check.IsNil)
defer conn.Close()
name := "test_platform_add"
args := make(map[string]string)
args["dockerfile"] = "http://localhost/Dockerfile"
err = PlatformAdd(provision.PlatformOptions{Name: name, Args: args})
defer conn.Platforms().Remove(bson.M{"_id": name})
c.Assert(err, check.NotNil)
count, err := conn.Platforms().FindId(name).Count()
c.Assert(err, check.IsNil)
c.Assert(count, check.Equals, 0)
}
开发者ID:pedrosnk,项目名称:tsuru,代码行数:22,代码来源:platform_test.go
示例4: TestPlatformAdd
func (s *PlatformSuite) TestPlatformAdd(c *check.C) {
provisioner := provisiontest.ExtensibleFakeProvisioner{
FakeProvisioner: provisiontest.NewFakeProvisioner(),
}
Provisioner = &provisioner
defer func() {
Provisioner = s.provisioner
}()
conn, err := db.Conn()
c.Assert(err, check.IsNil)
defer conn.Close()
name := "test_platform_add"
args := make(map[string]string)
args["dockerfile"] = "http://localhost/Dockerfile"
err = PlatformAdd(name, args, nil)
defer conn.Platforms().Remove(bson.M{"_id": name})
c.Assert(err, check.IsNil)
platform := provisioner.GetPlatform(name)
c.Assert(platform.Name, check.Equals, name)
c.Assert(platform.Args, check.DeepEquals, args)
c.Assert(platform.Version, check.Equals, 1)
}
开发者ID:nicolas2bonfils,项目名称:tsuru,代码行数:22,代码来源:platform_test.go
注:本文中的github.com/tsuru/tsuru/provision/provisiontest.ExtensibleFakeProvisioner类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论