ironic/ironic/tests
Miles Gould 34b3589ea3 Get mandatory patch attrs from WSME properties
Attributes which are mandatory (ie, required for object creation) should
not be removable. However, some attributes (such as Node.chassis_uuid)
are not required for object creation, but should not be removable if
they are set. This commit does the following:

 - rename JsonPatchType.mandatory_attrs to non_removable_attrs to better
   describe its meaning,
 - change its return type to set-of-strings for faster lookup
 - ensure all mandatory attributes on the type being patched are
   included in the set of non-removable attributes,
 - add a new field, JsonPatchType._extra_non_removable_attrs, which
   should be a set of attributes that are not required for creation but
   should not be removed if set.

Since the object to be patched does not exist at patch-validation time,
we leave the validation logic in methods of JsonPatchType and
subclasses. This means introspecting the types to be patched.

Closes-Bug: #1284781

Change-Id: I2bb7fed2c776c8d63535c5ee19cdc218e57806e3
2015-11-17 14:34:20 +00:00
..
functional Prepare for functional testing 2015-09-28 21:27:01 +00:00
unit Get mandatory patch attrs from WSME properties 2015-11-17 14:34:20 +00:00
__init__.py Prepare for functional testing 2015-09-28 21:27:01 +00:00
base.py Move ironic.tests.unit.base to ironic.tests.base 2015-10-22 08:57:41 -07:00