예제 #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
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)
}