def test_setup_nova_failing_unauthorized_user(self, mock_client):
    dummy_creds = {'AUTH_URL': 'this_url_is_valid', 'USERNAME':
        'my_bad_user. this should fail', 'PASSWORD':
        'bad_pass_but_it_does_not_matter_what_this_is', 'VERSION': '2.1',
        'PROJECT_ID': 'does_not_matter'}
mock_nova_client = mock_client.return_value
mock_nova_client.authenticate.side_effect = Unauthorized(401)
with self.assertRaises(UnauthorizedUser):
    setup_nova(dummy_creds)
Как я могу использовать unittest.mock для удаления побочных эффектов из кода?