Exemplo n.º 1
0
func (s *ConstraintsSuite) TestWithout(c *gc.C) {
	for i, t := range withoutTests {
		c.Logf("test %d", i)
		initial := constraints.MustParse(t.initial)
		final, err := constraints.Without(initial, t.without...)
		c.Assert(err, gc.IsNil)
		c.Check(final, gc.DeepEquals, constraints.MustParse(t.final))
	}
}
Exemplo n.º 2
0
func (s *ConstraintsSuite) TestWithoutError(c *gc.C) {
	cons := constraints.MustParse("mem=4G")
	_, err := constraints.Without(cons, "foo")
	c.Assert(err, gc.ErrorMatches, `unknown constraint "foo"`)
}