============================= test session starts ============================= platform win32 -- Python 3.6.3, pytest-3.5.0, py-1.5.3, pluggy-0.6.0 rootdir: F:\Projects\Ecosystem\azure-iot-cli-extension, inifile: plugins: mock-1.9.0, env-0.6.2, cov-2.5.1 collected 222 items azext_iot\tests\test_iot_ext_unit.py ................................... [ 15%] ........................................................................ [ 48%] ........................................................................ [ 80%] .....................EEEFFFFFEsssssssssssss [100%] =================================== ERRORS ==================================== ERROR at setup of TestDeviceSimulate.test_device_simulate[204-complete-1-1-http] thing = comp = '_mqtt', import_path = 'azext_iot.operations._mqtt' def _dot_lookup(thing, comp, import_path): try: > return getattr(thing, comp) E AttributeError: module 'azext_iot.operations' has no attribute '_mqtt' C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1071: AttributeError During handling of the above exception, another exception occurred: self = mocker = fixture_ghcs = fixture_sas = @pytest.fixture() def mqttclient(self, mocker, fixture_ghcs, fixture_sas): > client = mocker.patch(path_mqtt_client) test_iot_ext_unit.py:1502: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\azure-cli-fork\env\lib\site-packages\pytest_mock.py:156: in __call__ return self._start_patch(self.mock_module.patch, *args, **kwargs) ..\..\..\azure-cli-fork\env\lib\site-packages\pytest_mock.py:135: in _start_patch mocked = p.start() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1374: in start result = self.__enter__() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1227: in __enter__ self.target = self.getter() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1397: in getter = lambda: _importer(target) C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1084: in _importer thing = _dot_lookup(thing, comp, import_path) C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1073: in _dot_lookup __import__(import_path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError ERROR at setup of TestDeviceSimulate.test_device_simulate[204-abandon-2-1-http] thing = comp = '_mqtt', import_path = 'azext_iot.operations._mqtt' def _dot_lookup(thing, comp, import_path): try: > return getattr(thing, comp) E AttributeError: module 'azext_iot.operations' has no attribute '_mqtt' C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1071: AttributeError During handling of the above exception, another exception occurred: self = mocker = fixture_ghcs = fixture_sas = @pytest.fixture() def mqttclient(self, mocker, fixture_ghcs, fixture_sas): > client = mocker.patch(path_mqtt_client) test_iot_ext_unit.py:1502: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\azure-cli-fork\env\lib\site-packages\pytest_mock.py:156: in __call__ return self._start_patch(self.mock_module.patch, *args, **kwargs) ..\..\..\azure-cli-fork\env\lib\site-packages\pytest_mock.py:135: in _start_patch mocked = p.start() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1374: in start result = self.__enter__() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1227: in __enter__ self.target = self.getter() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1397: in getter = lambda: _importer(target) C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1084: in _importer thing = _dot_lookup(thing, comp, import_path) C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1073: in _dot_lookup __import__(import_path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError ERROR at setup of TestDeviceSimulate.test_device_simulate[204-complete-3-1-mqtt] thing = comp = '_mqtt', import_path = 'azext_iot.operations._mqtt' def _dot_lookup(thing, comp, import_path): try: > return getattr(thing, comp) E AttributeError: module 'azext_iot.operations' has no attribute '_mqtt' C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1071: AttributeError During handling of the above exception, another exception occurred: self = mocker = fixture_ghcs = fixture_sas = @pytest.fixture() def mqttclient(self, mocker, fixture_ghcs, fixture_sas): > client = mocker.patch(path_mqtt_client) test_iot_ext_unit.py:1502: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\azure-cli-fork\env\lib\site-packages\pytest_mock.py:156: in __call__ return self._start_patch(self.mock_module.patch, *args, **kwargs) ..\..\..\azure-cli-fork\env\lib\site-packages\pytest_mock.py:135: in _start_patch mocked = p.start() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1374: in start result = self.__enter__() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1227: in __enter__ self.target = self.getter() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1397: in getter = lambda: _importer(target) C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1084: in _importer thing = _dot_lookup(thing, comp, import_path) C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1073: in _dot_lookup __import__(import_path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError ____ ERROR at setup of TestDeviceSimulate.test_device_simulate_mqtt_error _____ thing = comp = '_mqtt', import_path = 'azext_iot.operations._mqtt' def _dot_lookup(thing, comp, import_path): try: > return getattr(thing, comp) E AttributeError: module 'azext_iot.operations' has no attribute '_mqtt' C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1071: AttributeError During handling of the above exception, another exception occurred: mocker = fixture_ghcs = fixture_sas = @pytest.fixture() def mqttclient_generic_error(mocker, fixture_ghcs, fixture_sas): > mqtt_client = mocker.patch(path_mqtt_client) test_iot_ext_unit.py:83: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\azure-cli-fork\env\lib\site-packages\pytest_mock.py:156: in __call__ return self._start_patch(self.mock_module.patch, *args, **kwargs) ..\..\..\azure-cli-fork\env\lib\site-packages\pytest_mock.py:135: in _start_patch mocked = p.start() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1374: in start result = self.__enter__() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1227: in __enter__ self.target = self.getter() C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1397: in getter = lambda: _importer(target) C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1084: in _importer thing = _dot_lookup(thing, comp, import_path) C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\mock.py:1073: in _dot_lookup __import__(import_path) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError ================================== FAILURES =================================== TestDeviceSimulate.test_device_simulate_invalid_args[204-reject-4-0-mqtt-CLIError] self = serviceclient = , rs = 'reject' mc = 4, mi = 0, protocol = 'mqtt', exception = @pytest.mark.parametrize("rs, mc, mi, protocol, exception", [ ('reject', 4, 0, 'mqtt', CLIError), ('complete', 0, 1, 'mqtt', CLIError) ]) def test_device_simulate_invalid_args(self, serviceclient, rs, mc, mi, protocol, exception): with pytest.raises(exception): subject.iot_simulate_device(fixture_cmd, device_id, hub_name=mock_target['entity'], > receive_settle=rs, msg_count=mc, msg_interval=mi, protocol_type=protocol) test_iot_ext_unit.py:1532: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\operations\hub.py:771: in iot_simulate_device from azext_iot.operations._mqtt import mqtt_client_wrap _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError TestDeviceSimulate.test_device_simulate_invalid_args[204-complete-0-1-mqtt-CLIError] self = serviceclient = , rs = 'complete' mc = 0, mi = 1, protocol = 'mqtt', exception = @pytest.mark.parametrize("rs, mc, mi, protocol, exception", [ ('reject', 4, 0, 'mqtt', CLIError), ('complete', 0, 1, 'mqtt', CLIError) ]) def test_device_simulate_invalid_args(self, serviceclient, rs, mc, mi, protocol, exception): with pytest.raises(exception): subject.iot_simulate_device(fixture_cmd, device_id, hub_name=mock_target['entity'], > receive_settle=rs, msg_count=mc, msg_interval=mi, protocol_type=protocol) test_iot_ext_unit.py:1532: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\operations\hub.py:771: in iot_simulate_device from azext_iot.operations._mqtt import mqtt_client_wrap _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError ___________ TestDeviceSimulate.test_device_simulate_http_error[400] ___________ self = serviceclient_generic_error = def test_device_simulate_http_error(self, serviceclient_generic_error): with pytest.raises(CLIError): > subject.iot_simulate_device(fixture_cmd, device_id, hub_name=mock_target['entity'], protocol_type='http') test_iot_ext_unit.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\operations\hub.py:771: in iot_simulate_device from azext_iot.operations._mqtt import mqtt_client_wrap _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError ___________ TestDeviceSimulate.test_device_simulate_http_error[401] ___________ self = serviceclient_generic_error = def test_device_simulate_http_error(self, serviceclient_generic_error): with pytest.raises(CLIError): > subject.iot_simulate_device(fixture_cmd, device_id, hub_name=mock_target['entity'], protocol_type='http') test_iot_ext_unit.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\operations\hub.py:771: in iot_simulate_device from azext_iot.operations._mqtt import mqtt_client_wrap _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError ___________ TestDeviceSimulate.test_device_simulate_http_error[500] ___________ self = serviceclient_generic_error = def test_device_simulate_http_error(self, serviceclient_generic_error): with pytest.raises(CLIError): > subject.iot_simulate_device(fixture_cmd, device_id, hub_name=mock_target['entity'], protocol_type='http') test_iot_ext_unit.py:1536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\operations\hub.py:771: in iot_simulate_device from azext_iot.operations._mqtt import mqtt_client_wrap _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import ssl import os from time import time, sleep import six > from paho.mqtt import client as mqtt E ModuleNotFoundError: No module named 'paho' ..\operations\_mqtt.py:13: ModuleNotFoundError ========== 5 failed, 200 passed, 13 skipped, 4 error in 5.16 seconds ==========