示例#1
0
文件: service_test.go 项目: bac/juju
func (*serviceSuite) TestValidateMissingExecStart(c *gc.C) {
	service := common.Service{
		Name: "a-application",
		Conf: common.Conf{
			Desc: "some service",
		},
	}
	err := service.Validate(renderer)

	c.Check(err, gc.ErrorMatches, ".*missing ExecStart.*")
}
示例#2
0
文件: service_test.go 项目: bac/juju
func (*serviceSuite) TestValidateMissingName(c *gc.C) {
	service := common.Service{
		Conf: common.Conf{
			Desc:      "some service",
			ExecStart: "/path/to/some-command x y z",
		},
	}
	err := service.Validate(renderer)

	c.Check(err, gc.ErrorMatches, ".*missing Name.*")
}
示例#3
0
文件: service_test.go 项目: bac/juju
func (*serviceSuite) TestValidateMissingDesc(c *gc.C) {
	service := common.Service{
		Name: "a-application",
		Conf: common.Conf{
			ExecStart: "/path/to/some-command x y z",
		},
	}
	err := service.Validate(renderer)

	c.Check(err, gc.ErrorMatches, ".*missing Desc.*")
}
示例#4
0
文件: service_test.go 项目: bac/juju
func (*serviceSuite) TestValidateOkay(c *gc.C) {
	service := common.Service{
		Name: "a-application",
		Conf: common.Conf{
			Desc:      "some service",
			ExecStart: "/path/to/some-command x y z",
		},
	}
	err := service.Validate(renderer)

	c.Check(err, jc.ErrorIsNil)
}