@mock.patch.object(volume_utils, "introduce_vdi")
    @mock.patch.object(volumeops.LOG, 'debug')
    def test_connect_hypervisor_to_volume_mask_password(self, mock_debug,
                                                        mock_intro):
        # Tests that the connection_data is scrubbed before logging.
        data = {'auth_password': 'verybadpass'}
        self.ops._connect_hypervisor_to_volume("sr", data)
        self.assertTrue(mock_debug.called, 'LOG.debug was not called')
        password_logged = False
        for call in mock_debug.call_args_list:
            # The call object is a tuple of (args, kwargs)
            if 'verybadpass' in call[0]:
                password_logged = True
                break
        self.assertFalse(password_logged, 'connection_data was not scrubbed')
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/virt/xenapi/test_volumeops.py/AttachVolumeTestCase.test_connect_hypervisor_to_volume_mask_password/original