Ejemplo n.º 1
0
    def stage(self, mocker, init_kwargs, fake_auth_provider):
        stage = pipeline_stages_iothub.UseAuthProviderStage(**init_kwargs)
        stage.send_op_down = mocker.MagicMock()
        stage.send_event_up = mocker.MagicMock()

        # Attach an auth provider
        set_auth_op = pipeline_ops_iothub.SetAuthProviderOperation(
            auth_provider=fake_auth_provider, callback=mocker.MagicMock())
        stage.run_op(set_auth_op)
        assert stage.auth_provider is fake_auth_provider
        stage.send_op_down.reset_mock()
        stage.send_event_up.reset_mock()
        return stage
 def op(self, mocker, fake_auth_provider):
     return pipeline_ops_iothub.SetAuthProviderOperation(
         auth_provider=fake_auth_provider, callback=mocker.MagicMock()
     )