Improve port update API unit tests
Improve port update API unit tests

Currently, the RPCAPI update_port method is mocked, and its return
value set in the unit tests to the expected value - the modified port.
This isn't really exercising all of the port update API handler, which
should be modifying the port object appropriately and passing it to the
RPCAPI update_port method.

This change adds a side effect to the RPCAPI update_port mock which
saves the Port object that it is passed to the DB. This allows us to
avoid fudging the answer and test the code more thoroughly.

The TestPost test case already does this for port creation.

Change-Id: I77860b2a24da659418f93c380db67ff4726257ff
Related-Bug: #1666009

pshchelo/ironic,SauloAislan/ironic,pshchelo/ironic,openstack/ironic,SauloAislan/ironic,openstack/ironic