本文整理汇总了Golang中github.com/juju/juju/version.Number.Minor方法的典型用法代码示例。如果您正苦于以下问题:Golang Number.Minor方法的具体用法?Golang Number.Minor怎么用?Golang Number.Minor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/version.Number
的用法示例。
在下文中一共展示了Number.Minor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestMongoRestoreArgsForVersion
func (s *mongoRestoreSuite) TestMongoRestoreArgsForVersion(c *gc.C) {
dir := filepath.Join(agent.DefaultDataDir, "db")
versionNumber := version.Number{}
versionNumber.Major = 1
versionNumber.Minor = 21
args, err := backups.MongoRestoreArgsForVersion(versionNumber, "/some/fake/path")
c.Assert(err, jc.ErrorIsNil)
c.Assert(args, gc.HasLen, 5)
c.Assert(args[0:5], jc.DeepEquals, []string{
"--drop",
"--journal",
"--dbpath",
dir,
"/some/fake/path",
})
versionNumber.Major = 1
versionNumber.Minor = 22
args, err = backups.MongoRestoreArgsForVersion(versionNumber, "/some/fake/path")
c.Assert(err, jc.ErrorIsNil)
c.Assert(args, gc.HasLen, 6)
c.Assert(args[0:6], jc.DeepEquals, []string{
"--drop",
"--journal",
"--oplogReplay",
"--dbpath",
dir,
"/some/fake/path",
})
versionNumber.Major = 0
versionNumber.Minor = 0
_, err = backups.MongoRestoreArgsForVersion(versionNumber, "/some/fake/path")
c.Assert(err, gc.ErrorMatches, "this backup file is incompatible with the current version of juju")
}
示例2: TestMongoRestoreArgsForOldVersion
func (s *mongoRestoreSuite) TestMongoRestoreArgsForOldVersion(c *gc.C) {
versionNumber := version.Number{}
versionNumber.Major = 0
versionNumber.Minor = 0
_, err := backups.MongoRestoreArgsForVersion(versionNumber, "/some/fake/path")
c.Assert(err, gc.ErrorMatches, "this backup file is incompatible with the current version of juju")
}
示例3: TestMongoRestoreArgsForVersion121
func (s *mongoRestoreSuite) TestMongoRestoreArgsForVersion121(c *gc.C) {
dir := filepath.Join(agent.DefaultPaths.DataDir, "db")
versionNumber := version.Number{}
versionNumber.Major = 1
versionNumber.Minor = 21
args, err := backups.MongoRestoreArgsForVersion(versionNumber, "/some/fake/path")
c.Assert(err, jc.ErrorIsNil)
c.Assert(args, gc.HasLen, 5)
c.Assert(args[0:5], jc.DeepEquals, []string{
"--drop",
"--journal",
"--dbpath",
dir,
"/some/fake/path",
})
}