Exemplo n.º 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
}
Exemplo n.º 2
0
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)
}