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) }
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) }