~mpontillo/maas/networks-list-view

« back to all changes in this revision

Viewing changes to src/maasserver/models/signals/tests/test_nodes.py

[r=blake-rouse][bug=][author=allenap] In the node_type_change_notify trigger, explicitly do nothing when a node is converted to or from a chassis.

There are some related drive-by fixes and simplifications too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
        chassis = factory.make_Node(node_type=NODE_TYPE.CHASSIS)
164
164
        chassis.node_type = NODE_TYPE.DEVICE
165
165
        chassis.save()
166
 
        error = None
167
 
        try:
168
 
            reload_object(chassis).chassis_hints
169
 
        except ChassisHints.DoesNotExist as exc:
170
 
            error = exc
171
 
        self.assertIsNotNone(error)
 
166
        self.assertRaises(
 
167
            ChassisHints.DoesNotExist,
 
168
            lambda: chassis.chassis_hints)