Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(376)

Unified Diff: provider/joyent/local_test.go

Issue 96730043: Support constraints vocabs (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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:.*")
+}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b