Add a fixture for dealing with mock patching.

Quantum uses a pattern all over their test base, which can be
collapsed down into a simple re-usable fixture.

Change-Id: I5944505ce44ce8b79a685c3ea392f001307b5319
Merge "Add a fixture for dealing with mock patching."