Exemple #1
0
func (s *ManifoldSuite) TestMissingAPICaller(c *gc.C) {
	manifold := storageprovisioner.Manifold(storageprovisioner.ManifoldConfig{
		APICallerName: "api-caller",
		ClockName:     "clock",
	})
	_, err := manifold.Start(dt.StubGetResource(dt.StubResources{
		"api-caller": dt.StubResource{Error: dependency.ErrMissing},
		"clock":      dt.StubResource{Output: struct{ clock.Clock }{}},
	}))
	c.Check(errors.Cause(err), gc.Equals, dependency.ErrMissing)
}
Exemple #2
0
func (s *ManifoldSuite) TestManifold(c *gc.C) {
	manifold := storageprovisioner.Manifold(storageprovisioner.ManifoldConfig{
		APICallerName: "grenouille",
		ClockName:     "bustopher",
	})
	c.Check(manifold.Inputs, jc.DeepEquals, []string{"grenouille", "bustopher"})
	c.Check(manifold.Output, gc.IsNil)
	c.Check(manifold.Start, gc.NotNil)
	// ...Start is *not* well-tested, in common with many manifold configs.
	// Am starting to think that tasdomas nailed it with the metrics manifolds
	// that take constructors as config... reviewers, thoughts please?
}