def pipeline_config(self, mocker): # auth type shouldn't matter for this stage, so just give it a fake sastoken for now. # Manually override to make this for modules cfg = config.IoTHubPipelineConfig(hostname="http://my.hostname", device_id="my_device", sastoken=mocker.MagicMock()) return cfg
def pipeline_config(self, mocker): # Because Storage/Blob related functionality is limited to Device, configure pipeline for a device # auth type shouldn't matter for this stage, so just give it a fake sastoken for now. cfg = config.IoTHubPipelineConfig(hostname="http://my.hostname", device_id="my_device", sastoken=mocker.MagicMock()) return cfg
def pipeline_config(self, mocker): cfg = config.IoTHubPipelineConfig( hostname="fake_hostname", device_id="my_device", module_id="my_module", sastoken=mocker.MagicMock(), ) return cfg
def pipeline_config(self, mocker): # NOTE 1: auth type shouldn't matter for this stage, so just give it a fake sastoken for now. # NOTE 2: This config is configured for a device, not a module. Where relevant, override this # fixture or dynamically add a module_id cfg = config.IoTHubPipelineConfig(hostname="http://my.hostname", device_id="my_device", sastoken=mocker.MagicMock()) return cfg
def pipeline_configuration(mocker): # NOTE: Consider parametrizing this to serve as both a device and module configuration. # The reason this isn't currently done is that it's not strictly necessary, but it might be # more correct and complete to do so. Certainly this must be done if any device/module # specific logic is added to the code under test. mock_config = config.IoTHubPipelineConfig(device_id="my_device", hostname="my.host.name", sastoken=mocker.MagicMock()) mock_config.sastoken.ttl = 1232 # set for compat return mock_config
def pipeline_config(self, mocker): # Because Method related functionality is limited to Module, configure the stage for a module # auth type shouldn't matter for this stage, so just give it a fake sastoken for now. cfg = config.IoTHubPipelineConfig( hostname="http://my.hostname", gateway_hostname="http://my.gateway.hostname", device_id="my_device", module_id="my_module", sastoken=mocker.MagicMock(), ) return cfg
def stage(self, mocker, cls_type, init_kwargs): stage = cls_type(**init_kwargs) pl_config = config.IoTHubPipelineConfig() stage.pipeline_root = pipeline_stages_base.PipelineRootStage( pipeline_configuration=pl_config) stage.send_op_down = mocker.MagicMock() stage.send_event_up = mocker.MagicMock() stage.device_id = "fake_device_id" stage.module_id = None stage.hostname = "fake_hostname" return stage