コード例 #1
0
ファイル: resource_test.go プロジェクト: bac/juju
func (s *ResourceSuite) TestOpenResourcePlaceholder(c *gc.C) {
	res := resourcetesting.NewPlaceholderResource(c, "spam", "a-application")
	s.persist.ReturnGetResource = res
	s.persist.ReturnGetResourcePath = "application-a-application/resources/spam"
	st := NewState(s.raw)
	s.stub.ResetCalls()

	_, _, err := st.OpenResource("a-application", "spam")

	s.stub.CheckCallNames(c, "GetResource")
	c.Check(err, jc.Satisfies, errors.IsNotFound)
}
コード例 #2
0
ファイル: resource_test.go プロジェクト: AlexisBruemmer/juju
func (s *ResourceSuite) TestOpenResourceForUniterPlaceholder(c *gc.C) {
	res := resourcetesting.NewPlaceholderResource(c, "spam", "a-service")
	s.persist.ReturnGetResource = res
	s.persist.ReturnGetResourcePath = "service-a-service/resources/spam"
	unit := newUnit(s.stub, "a-service/0")
	st := NewState(s.raw)
	s.stub.ResetCalls()

	_, _, err := st.OpenResourceForUniter(unit, "spam")

	s.stub.CheckCallNames(c, "ServiceName", "GetResource")
	c.Check(err, jc.Satisfies, errors.IsNotFound)
}