'Driver mock decorator.'

@staticmethod
def driver_mock_decorator(configuration):

    def driver_mock_wrapper(func):
        def inner_driver_mock(self, mock_http_connection, *args, **kwargs):
            'Inner    driver    mock.'
            self.mock_HTTPConnection = mock_http_connection
            self.driver = qnap.QnapISCSIDriver(configuration=configuration)
            self.driver.do_setup('context')
            func(self, *args, **kwargs)
        return inner_driver_mock
    return driver_mock_wrapper
