~fwereade/pyjuju/preflight-constraints

« back to all changes in this revision

Viewing changes to juju/machine/tests/test_constraints.py

  • Committer: William Reade
  • Date: 2012-04-04 15:39:01 UTC
  • mfrom: (494.1.18 trunk)
  • Revision ID: fwereade@gmail.com-20120404153901-aewisetre0zwgcus
finished tests, removed inappropriate preflighting

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from juju.lib.testing import TestCase
7
7
from juju.machine.constraints import Constraints, ConstraintSet
8
8
 
 
9
 
 
10
def _dummy_validate(constraints):
 
11
    if constraints["cpu"] == 666.666:
 
12
        return fail(PreflightError("disturbing symbolism"))
 
13
    return succeed(None)
 
14
 
 
15
 
9
16
# These objects exist for the convenience of other test files
10
 
dummy_cs = ConstraintSet("dummy")
 
17
dummy_cs = ConstraintSet("dummy", _dummy_validate)
11
18
dummy_cs.register_generics([])
12
19
dummy_constraints = dummy_cs.parse([])
13
20
series_constraints = dummy_constraints.with_series("series")