예제 #1
0
func (r resources) newHookContextFacade(st *corestate.State, unit *corestate.Unit) (interface{}, error) {
	res, err := st.Resources()
	if err != nil {
		return nil, errors.Trace(err)
	}
	return internalserver.NewUnitFacade(&resourcesUnitDataStore{res, unit}), nil
}
예제 #2
0
파일: unitfacade_test.go 프로젝트: bac/juju
func (s *UnitFacadeSuite) TestNewUnitFacade(c *gc.C) {
	expected := &stubUnitDataStore{Stub: s.stub}

	uf := server.NewUnitFacade(expected)

	s.stub.CheckNoCalls(c)
	c.Check(uf.DataStore, gc.Equals, expected)
}