# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import sys
import logging
from azure.iot.device.iothub.pipeline import pipeline_events_iothub
from tests.common.pipeline import pipeline_data_object_test

logging.basicConfig(level=logging.INFO)
this_module = sys.modules[__name__]

pipeline_data_object_test.add_event_test(
    cls=pipeline_events_iothub.C2DMessageEvent,
    module=this_module,
    positional_arguments=["message"],
    keyword_arguments={},
)
pipeline_data_object_test.add_event_test(
    cls=pipeline_events_iothub.InputMessageEvent,
    module=this_module,
    positional_arguments=["input_name", "message"],
    keyword_arguments={},
)
pipeline_data_object_test.add_event_test(
    cls=pipeline_events_iothub.MethodRequestEvent,
    module=this_module,
    positional_arguments=["method_request"],
    keyword_arguments={},
)
pipeline_data_object_test.add_event_test(
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import sys
import pytest
import logging
from azure.iot.device.common.pipeline import pipeline_events_base
from tests.common.pipeline import pipeline_data_object_test

logging.basicConfig(level=logging.DEBUG)
this_module = sys.modules[__name__]


@pytest.mark.describe("PipelineEvent")
class TestPipelineOperation(object):
    @pytest.mark.it("Can't be instantiated")
    def test_instantiate(self):
        with pytest.raises(TypeError):
            pipeline_events_base.PipelineEvent()


pipeline_data_object_test.add_event_test(
    cls=pipeline_events_base.IotResponseEvent,
    module=this_module,
    positional_arguments=["request_id", "status_code", "response_body"],
    keyword_arguments={},
)
Exemple #3
0
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import sys
import logging
from azure.iot.device.provisioning.pipeline import pipeline_events_provisioning
from tests.common.pipeline import pipeline_data_object_test

logging.basicConfig(level=logging.DEBUG)
this_module = sys.modules[__name__]

pipeline_data_object_test.add_event_test(
    cls=pipeline_events_provisioning.RegistrationResponseEvent,
    module=this_module,
    positional_arguments=["request_id", "status_code", "key_values", "response_payload"],
    keyword_arguments={},
)
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import sys
import logging
from azure.iot.device.common.pipeline import pipeline_events_mqtt
from tests.common.pipeline import pipeline_data_object_test

logging.basicConfig(level=logging.DEBUG)

this_module = sys.modules[__name__]

pipeline_data_object_test.add_event_test(
    cls=pipeline_events_mqtt.IncomingMQTTMessageEvent,
    module=this_module,
    positional_arguments=["topic", "payload"],
    keyword_arguments={},
)