def side_effect(mo, **kwargs): fault = mock.Mock(faultstring="MyFault") raise suds.WebFault(fault, None)
def test_invalid_login(self, mock_client): mock_client.return_value.service.Login.side_effect = suds.WebFault( 'Permission to perform this operation was denied.', '') self.assertRaises(VirtError, self.run_once)
def fail_with_web_fault(message): fault = mock.Mock() fault.faultstring = "General error." document = mock.Mock() raise suds.WebFault(fault, document)