def serviceclient(self, mocker, fixture_ghcs, request): service_client = mocker.patch(path_service_client) payload = { "continuationToken": "null", "results": [{ "comment": "", "createdOn": "2019-07-09T07:46:06.044161+00:00", "description": "", "displayName": "Mxchip 1", "etag": "\"41006e67-0000-0800-0000-5d2501b80000\"", "modelName": "example:capabilityModels:Mxchip", "publisherId": "aabbaabb-aabb-aabb-aabb-aabbaabbaabb", "publisherName": "microsoft.com", "type": "CapabilityModel", "updatedOn": "2019-07-09T21:06:00.072063+00:00", "urnId": "urn:example:capabilityModels:Mxchip:1", "version": 1 }] } test_side_effect = [ build_mock_response(mocker, request.param[0], payload=payload), build_mock_response(mocker, request.param[1], {}) ] service_client.side_effect = test_side_effect return service_client
def serviceclient(self, mocker, fixture_ghcs, request): service_client = mocker.patch(path_service_client) payload_list = { "continuationToken": "null", "results": [{ "comment": "", "createdOn": "2019-07-09T07:46:06.044161+00:00", "description": "", "displayName": "MXChip 1", "etag": "\"41006e67-0000-0800-0000-5d2501b80000\"", "modelName": "example:interfaces:MXChip", "publisherId": "aabbaabb-aabb-aabb-aabb-aabbaabbaabb", "publisherName": "microsoft.com", "type": "Interface", "updatedOn": "2019-07-09T21:06:00.072063+00:00", "urnId": "urn:example:interfaces:MXChip:1", "version": 1 }] } payload_show = { "@id": "urn:example:interfaces:MXChip:1", "@type": "Interface", "displayName": "MXChip 1", "contents": [{ "@type": "Property", "displayName": "Die Number", "name": "dieNumber", "schema": "double" }], "@context": "http://azureiot.com/v1/contexts/Interface.json" } test_side_effect = [ build_mock_response(mocker, request.param[0], payload=payload_list), build_mock_response(mocker, request.param[1], payload=payload_show), build_mock_response(mocker, request.param[2], {}) ] service_client.side_effect = test_side_effect return service_client
def serviceclient(self, mocker, fixture_ghcs, request): service_client = mocker.patch(path_service_client) payload = { "@id": "urn:example:capabilityModels:Mxchip:1", "@type": "CapabilityModel", "displayName": "Mxchip 1", "implements": [{ "schema": "urn:example:interfaces:MXChip:1", "name": "MXChip1" }], "@context": "http://azureiot.com/v1/contexts/CapabilityModel.json" } service_client.return_value = build_mock_response(mocker, request.param, payload=payload) return service_client
def serviceclient(self, mocker, fixture_ghcs, request): service_client = mocker.patch(path_service_client) payload = { "@id": "urn:example:interfaces:MXChip:1", "@type": "Interface", "displayName": "MXChip 1", "contents": [{ "@type": "Property", "displayName": "Die Number", "name": "dieNumber", "schema": "double" }], "@context": "http://azureiot.com/v1/contexts/Interface.json" } service_client.return_value = build_mock_response( mocker, request.param, payload) return service_client
def service_client(self, mocker, fixture_ghcs, request): serviceclient = mocker.patch(path_service_client) payload = { "continuationToken": "null", "results": [{ "comment": "", "createdOn": "2019-07-09T07:46:06.044161+00:00", "description": "", "displayName": "MXChip 1", "etag": "\"41006e67-0000-0800-0000-5d2501b80000\"", "modelName": "example:interfaces:MXChip", "publisherId": "aabbaabb-aabb-aabb-aabb-aabbaabbaabb", "publisherName": "microsoft.com", "type": "Interface", "updatedOn": "2019-07-09T21:06:00.072063+00:00", "urnId": "urn:example:interfaces:MXChip:1", "version": 1 }] } serviceclient.return_value = build_mock_response( mocker, request.param, payload) return serviceclient
def serviceclient(self, mocker, fixture_ghcs, request): service_client = mocker.patch(path_service_client) service_client.return_value = build_mock_response( mocker, request.param, {}) return service_client