Fix wrong usage of assertRaises

In some of the unit tests, assertRaises method is not used in the intended
manner.
Example: self.assertRaises(exceptions.VimFaultException,
                           lambda: api_session.invoke_api(module, 'api'))

This change fixes such usage.

Change-Id: Ia66ee33c90e333aa4378d797d1fecb62731bab11
Closes-Bug: #1338458