Index: provider/joyent/local_test.go |
=== modified file 'provider/joyent/local_test.go' |
--- provider/joyent/local_test.go 2014-04-18 13:49:33 +0000 |
+++ provider/joyent/local_test.go 2014-04-24 02:22:13 +0000 |
@@ -424,9 +424,22 @@ |
func (s *localServerSuite) TestConstraintsValidator(c *gc.C) { |
env := s.Prepare(c) |
- validator := env.ConstraintsValidator() |
+ validator, err := env.ConstraintsValidator() |
+ c.Assert(err, gc.IsNil) |
cons := constraints.MustParse("arch=amd64 tags=bar cpu-power=10") |
unsupported, err := validator.Validate(cons) |
c.Assert(err, gc.IsNil) |
c.Assert(unsupported, gc.DeepEquals, []string{"cpu-power", "tags"}) |
} |
+ |
+func (s *localServerSuite) TestConstraintsValidatorVocab(c *gc.C) { |
+ env := s.Prepare(c) |
+ validator, err := env.ConstraintsValidator() |
+ c.Assert(err, gc.IsNil) |
+ cons := constraints.MustParse("arch=ppc64") |
+ _, err = validator.Validate(cons) |
+ c.Assert(err, gc.ErrorMatches, "invalid constraint value: arch=ppc64\nvalid values are:.*") |
+ cons = constraints.MustParse("instance-type=foo") |
+ _, err = validator.Validate(cons) |
+ c.Assert(err, gc.ErrorMatches, "invalid constraint value: instance-type=foo\nvalid values are:.*") |
+} |