'``VolumeScript._create_volume_service`` uses
``VolumeScript._service_factory`` to create a ``VolumeService`` (or
whatever else that hook decides to create).'

def test_service_factory(self):

    expected = Service()
    script = VolumeScript(object())
    self.patch(VolumeScript, '_service_factory', staticmethod((lambda config_path, pool, reactor: expected)))
    options = VolumeOptions()
    options.parseOptions([])
    service = script._create_volume_service(object(), object(), options)
    self.assertIs(expected, service)
