From 7c49f5a8b74077d2a2c28dec8e2040ec4260282b Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Thu, 7 Mar 2024 09:09:48 +0100 Subject: [PATCH 1/4] Add support for Status and Type fields in app context --- .../objects_v2/channel/get_all_channels.py | 5 +- .../objects_v2/channel/get_channel.py | 7 +-- .../objects_v2/channel/set_channel.py | 17 ++++++- .../endpoints/objects_v2/objects_endpoint.py | 46 +++++++++++++++++++ .../endpoints/objects_v2/uuid/get_all_uuid.py | 5 +- pubnub/endpoints/objects_v2/uuid/get_uuid.py | 5 +- pubnub/endpoints/objects_v2/uuid/set_uuid.py | 8 +++- 7 files changed, 80 insertions(+), 13 deletions(-) diff --git a/pubnub/endpoints/objects_v2/channel/get_all_channels.py b/pubnub/endpoints/objects_v2/channel/get_all_channels.py index 8e7e8815..6b6e732d 100644 --- a/pubnub/endpoints/objects_v2/channel/get_all_channels.py +++ b/pubnub/endpoints/objects_v2/channel/get_all_channels.py @@ -1,17 +1,18 @@ from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, ListEndpoint, \ - IncludeCustomEndpoint + IncludeCustomEndpoint, IncludeStatusTypeEndpoint from pubnub.enums import PNOperationType from pubnub.enums import HttpMethod from pubnub.models.consumer.objects_v2.channel import PNGetAllChannelMetadataResult -class GetAllChannels(ObjectsEndpoint, ListEndpoint, IncludeCustomEndpoint): +class GetAllChannels(ObjectsEndpoint, ListEndpoint, IncludeCustomEndpoint, IncludeStatusTypeEndpoint): GET_ALL_CHANNELS_PATH = "/v2/objects/%s/channels" def __init__(self, pubnub): ObjectsEndpoint.__init__(self, pubnub) ListEndpoint.__init__(self) IncludeCustomEndpoint.__init__(self) + IncludeStatusTypeEndpoint.__init__(self) def build_path(self): return GetAllChannels.GET_ALL_CHANNELS_PATH % self.pubnub.config.subscribe_key diff --git a/pubnub/endpoints/objects_v2/channel/get_channel.py b/pubnub/endpoints/objects_v2/channel/get_channel.py index b507be35..58cc7064 100644 --- a/pubnub/endpoints/objects_v2/channel/get_channel.py +++ b/pubnub/endpoints/objects_v2/channel/get_channel.py @@ -1,17 +1,18 @@ -from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, IncludeCustomEndpoint, \ - ChannelEndpoint +from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, IncludeCustomEndpoint, ChannelEndpoint, \ + IncludeStatusTypeEndpoint from pubnub.enums import PNOperationType from pubnub.enums import HttpMethod from pubnub.models.consumer.objects_v2.channel import PNGetChannelMetadataResult -class GetChannel(ObjectsEndpoint, ChannelEndpoint, IncludeCustomEndpoint): +class GetChannel(ObjectsEndpoint, ChannelEndpoint, IncludeCustomEndpoint, IncludeStatusTypeEndpoint): GET_CHANNEL_PATH = "/v2/objects/%s/channels/%s" def __init__(self, pubnub): ObjectsEndpoint.__init__(self, pubnub) ChannelEndpoint.__init__(self) IncludeCustomEndpoint.__init__(self) + IncludeStatusTypeEndpoint.__init__(self) def build_path(self): return GetChannel.GET_CHANNEL_PATH % (self.pubnub.config.subscribe_key, self._channel) diff --git a/pubnub/endpoints/objects_v2/channel/set_channel.py b/pubnub/endpoints/objects_v2/channel/set_channel.py index 32d4d7a1..778dad7c 100644 --- a/pubnub/endpoints/objects_v2/channel/set_channel.py +++ b/pubnub/endpoints/objects_v2/channel/set_channel.py @@ -1,12 +1,13 @@ from pubnub import utils from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, IncludeCustomEndpoint, \ - ChannelEndpoint, CustomAwareEndpoint + ChannelEndpoint, CustomAwareEndpoint, IncludeStatusTypeEndpoint, StatusTypeAwareEndpoint from pubnub.enums import PNOperationType from pubnub.enums import HttpMethod from pubnub.models.consumer.objects_v2.channel import PNSetChannelMetadataResult -class SetChannel(ObjectsEndpoint, ChannelEndpoint, IncludeCustomEndpoint, CustomAwareEndpoint): +class SetChannel(ObjectsEndpoint, ChannelEndpoint, IncludeCustomEndpoint, CustomAwareEndpoint, + IncludeStatusTypeEndpoint, StatusTypeAwareEndpoint): SET_CHANNEL_PATH = "/v2/objects/%s/channels/%s" def __init__(self, pubnub): @@ -14,14 +15,25 @@ def __init__(self, pubnub): ChannelEndpoint.__init__(self) CustomAwareEndpoint.__init__(self) IncludeCustomEndpoint.__init__(self) + IncludeStatusTypeEndpoint.__init__(self) self._name = None self._description = None + self._status = None + self._type = None def set_name(self, name): self._name = str(name) return self + def set_status(self, status: str = None): + self._status = status + return self + + def set_type(self, type: str = None): + self._type = type + return self + def description(self, description): self._description = str(description) return self @@ -38,6 +50,7 @@ def build_data(self): "description": self._description, "custom": self._custom } + payload = StatusTypeAwareEndpoint.build_data(self, payload) return utils.write_value_as_string(payload) def create_response(self, envelope): diff --git a/pubnub/endpoints/objects_v2/objects_endpoint.py b/pubnub/endpoints/objects_v2/objects_endpoint.py index d6a5675f..3ee6b88a 100644 --- a/pubnub/endpoints/objects_v2/objects_endpoint.py +++ b/pubnub/endpoints/objects_v2/objects_endpoint.py @@ -47,6 +47,12 @@ def custom_params(self): if self._include_custom: inclusions.append("custom") + if isinstance(self, IncludeStatusTypeEndpoint): + if self._include_status: + inclusions.append("status") + if self._include_type: + inclusions.append("type") + if isinstance(self, UUIDIncludeEndpoint): if self._uuid_details_level: if self._uuid_details_level == UUIDIncludeEndpoint.UUID: @@ -100,8 +106,32 @@ def __init__(self): def custom(self, custom): self._custom = dict(custom) + self._include_custom = True + return self + + +class StatusTypeAwareEndpoint: + __metaclass__ = ABCMeta + + def __init__(self): + self._status = None + self._type = None + + def set_status(self, status: str): + self._status = status + return self + + def set_type(self, type): + self._type = type return self + def build_data(self, payload): + if self._status: + payload["status"] = self._status + if self._type: + payload["type"] = self._type + return payload + class ChannelEndpoint: __metaclass__ = ABCMeta @@ -181,6 +211,22 @@ def include_custom(self, include_custom): return self +class IncludeStatusTypeEndpoint: + __metaclass__ = ABCMeta + + def __init__(self): + self._include_status = True + self._include_type = True + + def include_status(self, include_status): + self._include_status = bool(include_status) + return self + + def include_type(self, include_type): + self._include_type = bool(include_type) + return self + + class UUIDIncludeEndpoint: __metaclass__ = ABCMeta diff --git a/pubnub/endpoints/objects_v2/uuid/get_all_uuid.py b/pubnub/endpoints/objects_v2/uuid/get_all_uuid.py index b439b1f0..9e57b969 100644 --- a/pubnub/endpoints/objects_v2/uuid/get_all_uuid.py +++ b/pubnub/endpoints/objects_v2/uuid/get_all_uuid.py @@ -1,17 +1,18 @@ from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, ListEndpoint, \ - IncludeCustomEndpoint + IncludeCustomEndpoint, IncludeStatusTypeEndpoint from pubnub.enums import PNOperationType from pubnub.enums import HttpMethod from pubnub.models.consumer.objects_v2.uuid import PNGetAllUUIDMetadataResult -class GetAllUuid(ObjectsEndpoint, ListEndpoint, IncludeCustomEndpoint): +class GetAllUuid(ObjectsEndpoint, ListEndpoint, IncludeCustomEndpoint, IncludeStatusTypeEndpoint): GET_ALL_UID_PATH = "/v2/objects/%s/uuids" def __init__(self, pubnub): ObjectsEndpoint.__init__(self, pubnub) ListEndpoint.__init__(self) IncludeCustomEndpoint.__init__(self) + IncludeStatusTypeEndpoint.__init__(self) def build_path(self): return GetAllUuid.GET_ALL_UID_PATH % self.pubnub.config.subscribe_key diff --git a/pubnub/endpoints/objects_v2/uuid/get_uuid.py b/pubnub/endpoints/objects_v2/uuid/get_uuid.py index 8fc10cef..9dd0ada7 100644 --- a/pubnub/endpoints/objects_v2/uuid/get_uuid.py +++ b/pubnub/endpoints/objects_v2/uuid/get_uuid.py @@ -1,17 +1,18 @@ from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, \ - IncludeCustomEndpoint, UuidEndpoint + IncludeCustomEndpoint, UuidEndpoint, IncludeStatusTypeEndpoint from pubnub.enums import PNOperationType from pubnub.enums import HttpMethod from pubnub.models.consumer.objects_v2.uuid import PNGetUUIDMetadataResult -class GetUuid(ObjectsEndpoint, UuidEndpoint, IncludeCustomEndpoint): +class GetUuid(ObjectsEndpoint, UuidEndpoint, IncludeCustomEndpoint, IncludeStatusTypeEndpoint): GET_UID_PATH = "/v2/objects/%s/uuids/%s" def __init__(self, pubnub): ObjectsEndpoint.__init__(self, pubnub) UuidEndpoint.__init__(self) IncludeCustomEndpoint.__init__(self) + IncludeStatusTypeEndpoint.__init__(self) def build_path(self): return GetUuid.GET_UID_PATH % (self.pubnub.config.subscribe_key, self._effective_uuid()) diff --git a/pubnub/endpoints/objects_v2/uuid/set_uuid.py b/pubnub/endpoints/objects_v2/uuid/set_uuid.py index bd23ef00..c980e807 100644 --- a/pubnub/endpoints/objects_v2/uuid/set_uuid.py +++ b/pubnub/endpoints/objects_v2/uuid/set_uuid.py @@ -1,12 +1,13 @@ from pubnub import utils from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, UuidEndpoint, \ - IncludeCustomEndpoint, CustomAwareEndpoint + IncludeCustomEndpoint, CustomAwareEndpoint, IncludeStatusTypeEndpoint, StatusTypeAwareEndpoint from pubnub.enums import PNOperationType from pubnub.enums import HttpMethod from pubnub.models.consumer.objects_v2.uuid import PNSetUUIDMetadataResult -class SetUuid(ObjectsEndpoint, UuidEndpoint, IncludeCustomEndpoint, CustomAwareEndpoint): +class SetUuid(ObjectsEndpoint, UuidEndpoint, IncludeCustomEndpoint, CustomAwareEndpoint, IncludeStatusTypeEndpoint, + StatusTypeAwareEndpoint): SET_UID_PATH = "/v2/objects/%s/uuids/%s" def __init__(self, pubnub): @@ -14,6 +15,8 @@ def __init__(self, pubnub): UuidEndpoint.__init__(self) IncludeCustomEndpoint.__init__(self) CustomAwareEndpoint.__init__(self) + IncludeStatusTypeEndpoint.__init__(self) + StatusTypeAwareEndpoint.__init__(self) self._name = None self._email = None @@ -47,6 +50,7 @@ def build_data(self): "profileUrl": self._profile_url, "custom": self._custom } + payload = StatusTypeAwareEndpoint.build_data(self, payload) return utils.write_value_as_string(payload) def validate_specific_params(self): From fe1440f463202ca8071ba0f9593b677abfd3c2ad Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Thu, 7 Mar 2024 09:10:50 +0100 Subject: [PATCH 2/4] Add tests for metadata fields (app context) --- .../metadata/get_all_channel_metadata.json | 108 +++++++++++ .../metadata/get_all_uuid_metadata.json | 108 +++++++++++ .../metadata/get_channel_metadata.json | 55 ++++++ .../metadata/get_uuid_metadata.json | 55 ++++++ .../metadata/remove_channel_metadata.json | 161 ++++++++++++++++ .../metadata/remove_uuid_metadata.json | 161 ++++++++++++++++ .../metadata/set_channel_metadata.json | 58 ++++++ .../metadata/set_uuid_metadata.json | 58 ++++++ .../native_sync/test_metadata.py | 180 ++++++++++++++++++ 9 files changed, 944 insertions(+) create mode 100644 tests/integrational/fixtures/native_sync/metadata/get_all_channel_metadata.json create mode 100644 tests/integrational/fixtures/native_sync/metadata/get_all_uuid_metadata.json create mode 100644 tests/integrational/fixtures/native_sync/metadata/get_channel_metadata.json create mode 100644 tests/integrational/fixtures/native_sync/metadata/get_uuid_metadata.json create mode 100644 tests/integrational/fixtures/native_sync/metadata/remove_channel_metadata.json create mode 100644 tests/integrational/fixtures/native_sync/metadata/remove_uuid_metadata.json create mode 100644 tests/integrational/fixtures/native_sync/metadata/set_channel_metadata.json create mode 100644 tests/integrational/fixtures/native_sync/metadata/set_uuid_metadata.json create mode 100644 tests/integrational/native_sync/test_metadata.py diff --git a/tests/integrational/fixtures/native_sync/metadata/get_all_channel_metadata.json b/tests/integrational/fixtures/native_sync/metadata/get_all_channel_metadata.json new file mode 100644 index 00000000..ce52fc7f --- /dev/null +++ b/tests/integrational/fixtures/native_sync/metadata/get_all_channel_metadata.json @@ -0,0 +1,108 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/metadata_channel-two?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"name\", \"description\": \"This is a description\", \"custom\": {\"foo\": \"bar\"}, \"status\": \"Testing\", \"type\": \"test\"}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "119" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:38 GMT" + ], + "Content-Length": [ + "241" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"metadata_channel-two\",\"name\":\"name\",\"description\":\"This is a description\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:38.231243Z\",\"eTag\":\"f5046bfa9750b8b2cad4cd90ddacec76\"}}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels?include=custom%2Cstatus%2Ctype", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:38 GMT" + ], + "Content-Length": [ + "471" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"id\":\"metadata_channel\",\"name\":\"name\",\"description\":\"This is a description\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:37.715484Z\",\"eTag\":\"d392f5ad1048cc8980f549c104b9b958\"},{\"id\":\"metadata_channel-two\",\"name\":\"name\",\"description\":\"This is a description\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:38.231243Z\",\"eTag\":\"f5046bfa9750b8b2cad4cd90ddacec76\"}],\"next\":\"Mg\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/metadata/get_all_uuid_metadata.json b/tests/integrational/fixtures/native_sync/metadata/get_all_uuid_metadata.json new file mode 100644 index 00000000..ff5ac195 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/metadata/get_all_uuid_metadata.json @@ -0,0 +1,108 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/metadata_uuid-two?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"name\", \"email\": \"example@127.0.0.1\", \"externalId\": \"externalId\", \"profileUrl\": \"https://127.0.0.1\", \"custom\": {\"foo\": \"bar\"}, \"status\": \"Testing\", \"type\": \"test\"}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "172" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:39 GMT" + ], + "Content-Length": [ + "287" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"metadata_uuid-two\",\"name\":\"name\",\"externalId\":\"externalId\",\"profileUrl\":\"https://127.0.0.1\",\"email\":\"example@127.0.0.1\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:39.652544Z\",\"eTag\":\"64eea57a0b1f3cd866dd0ecd21646bb5\"}}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids?include=custom%2Cstatus%2Ctype", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:39 GMT" + ], + "Content-Length": [ + "563" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"id\":\"metadata_uuid\",\"name\":\"name\",\"externalId\":\"externalId\",\"profileUrl\":\"https://127.0.0.1\",\"email\":\"example@127.0.0.1\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:39.217435Z\",\"eTag\":\"7130ce49e71002c4fc018aa7678bc44e\"},{\"id\":\"metadata_uuid-two\",\"name\":\"name\",\"externalId\":\"externalId\",\"profileUrl\":\"https://127.0.0.1\",\"email\":\"example@127.0.0.1\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:39.652544Z\",\"eTag\":\"64eea57a0b1f3cd866dd0ecd21646bb5\"}],\"next\":\"Mg\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/metadata/get_channel_metadata.json b/tests/integrational/fixtures/native_sync/metadata/get_channel_metadata.json new file mode 100644 index 00000000..ca813f66 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/metadata/get_channel_metadata.json @@ -0,0 +1,55 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/metadata_channel?include=custom%2Cstatus%2Ctype", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:37 GMT" + ], + "Content-Length": [ + "237" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"metadata_channel\",\"name\":\"name\",\"description\":\"This is a description\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:37.715484Z\",\"eTag\":\"d392f5ad1048cc8980f549c104b9b958\"}}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/metadata/get_uuid_metadata.json b/tests/integrational/fixtures/native_sync/metadata/get_uuid_metadata.json new file mode 100644 index 00000000..5a6d1429 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/metadata/get_uuid_metadata.json @@ -0,0 +1,55 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/metadata_uuid?include=custom%2Cstatus%2Ctype", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:39 GMT" + ], + "Content-Length": [ + "283" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"metadata_uuid\",\"name\":\"name\",\"externalId\":\"externalId\",\"profileUrl\":\"https://127.0.0.1\",\"email\":\"example@127.0.0.1\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:39.217435Z\",\"eTag\":\"7130ce49e71002c4fc018aa7678bc44e\"}}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/metadata/remove_channel_metadata.json b/tests/integrational/fixtures/native_sync/metadata/remove_channel_metadata.json new file mode 100644 index 00000000..c0800c20 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/metadata/remove_channel_metadata.json @@ -0,0 +1,161 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "DELETE", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/metadata_channel", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:38 GMT" + ], + "Content-Length": [ + "26" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":null}" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/metadata_channel-two", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:38 GMT" + ], + "Content-Length": [ + "26" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":null}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels?include=custom%2Cstatus%2Ctype", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:39 GMT" + ], + "Content-Length": [ + "24" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[]}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/metadata/remove_uuid_metadata.json b/tests/integrational/fixtures/native_sync/metadata/remove_uuid_metadata.json new file mode 100644 index 00000000..4caea61e --- /dev/null +++ b/tests/integrational/fixtures/native_sync/metadata/remove_uuid_metadata.json @@ -0,0 +1,161 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "DELETE", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/metadata_uuid", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:40 GMT" + ], + "Content-Length": [ + "26" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":null}" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/metadata_uuid-two", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:40 GMT" + ], + "Content-Length": [ + "26" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":null}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids?include=custom%2Cstatus%2Ctype", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:40 GMT" + ], + "Content-Length": [ + "24" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[]}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/metadata/set_channel_metadata.json b/tests/integrational/fixtures/native_sync/metadata/set_channel_metadata.json new file mode 100644 index 00000000..d60f480d --- /dev/null +++ b/tests/integrational/fixtures/native_sync/metadata/set_channel_metadata.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/metadata_channel?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"name\", \"description\": \"This is a description\", \"custom\": {\"foo\": \"bar\"}, \"status\": \"Testing\", \"type\": \"test\"}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "119" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:37 GMT" + ], + "Content-Length": [ + "237" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"metadata_channel\",\"name\":\"name\",\"description\":\"This is a description\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:37.715484Z\",\"eTag\":\"d392f5ad1048cc8980f549c104b9b958\"}}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/metadata/set_uuid_metadata.json b/tests/integrational/fixtures/native_sync/metadata/set_uuid_metadata.json new file mode 100644 index 00000000..3255721d --- /dev/null +++ b/tests/integrational/fixtures/native_sync/metadata/set_uuid_metadata.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/metadata_uuid?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"name\", \"email\": \"example@127.0.0.1\", \"externalId\": \"externalId\", \"profileUrl\": \"https://127.0.0.1\", \"custom\": {\"foo\": \"bar\"}, \"status\": \"Testing\", \"type\": \"test\"}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "172" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Mar 2024 20:43:39 GMT" + ], + "Content-Length": [ + "283" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"metadata_uuid\",\"name\":\"name\",\"externalId\":\"externalId\",\"profileUrl\":\"https://127.0.0.1\",\"email\":\"example@127.0.0.1\",\"type\":\"test\",\"status\":\"Testing\",\"custom\":{\"foo\":\"bar\"},\"updated\":\"2024-03-06T20:43:39.217435Z\",\"eTag\":\"7130ce49e71002c4fc018aa7678bc44e\"}}" + } + } + } + ] +} diff --git a/tests/integrational/native_sync/test_metadata.py b/tests/integrational/native_sync/test_metadata.py new file mode 100644 index 00000000..c506963f --- /dev/null +++ b/tests/integrational/native_sync/test_metadata.py @@ -0,0 +1,180 @@ +import pytest + +from pubnub.pubnub import PubNub +from pubnub.models.consumer.common import PNStatus +from pubnub.models.consumer.objects_v2.channel import PNRemoveChannelMetadataResult, PNSetChannelMetadataResult, \ + PNGetChannelMetadataResult, PNGetAllChannelMetadataResult +from pubnub.models.consumer.objects_v2.uuid import PNSetUUIDMetadataResult, PNGetUUIDMetadataResult, \ + PNGetAllUUIDMetadataResult, PNRemoveUUIDMetadataResult +from pubnub.structures import Envelope +from tests.helper import pnconf_env_copy +from tests.integrational.vcr_helper import pn_vcr + + +@pytest.fixture +def pubnub(): + config = pnconf_env_copy() + config.enable_subscribe = False + return PubNub(config) + + +def assert_envelope_of_type(envelope, expected_type): + assert isinstance(envelope, Envelope) + assert isinstance(envelope.status, PNStatus) + assert not envelope.status.is_error() + assert isinstance(envelope.result, expected_type) + + +# Channel metadata + +@pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/metadata/set_channel_metadata.json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk'], serializer='pn_json') +def test_set_channel_metadata(pubnub): + channel = 'metadata_channel' + set_result = pubnub.set_channel_metadata().channel(channel) \ + .set_name('name') \ + .description('This is a description') \ + .set_status('Testing').set_type('test') \ + .custom({"foo": "bar"}).sync() + + assert_envelope_of_type(set_result, PNSetChannelMetadataResult) + assert set_result.result.data['id'] == channel + assert set_result.result.data['name'] == 'name' + assert set_result.result.data['description'] == 'This is a description' + assert set_result.result.data['custom'] == {"foo": "bar"} + assert set_result.result.data['status'] == 'Testing' + assert set_result.result.data['type'] == 'test' + + +@pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/metadata/get_channel_metadata.json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk'], serializer='pn_json') +def test_get_channel_metadata(pubnub): + channel = 'metadata_channel' + get_result = pubnub.get_channel_metadata().channel(channel).include_custom(True).sync() + assert_envelope_of_type(get_result, PNGetChannelMetadataResult) + assert get_result.result.data['id'] == channel + assert get_result.result.data['name'] == 'name' + assert get_result.result.data['description'] == 'This is a description' + assert get_result.result.data['custom'] == {"foo": "bar"} + assert get_result.result.data['status'] == 'Testing' + assert get_result.result.data['type'] == 'test' + + +@pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/metadata/get_all_channel_metadata.json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk'], serializer='pn_json') +def test_get_all_channel_metadata(pubnub): + channel = 'metadata_channel' + + pubnub.set_channel_metadata().channel(f'{channel}-two') \ + .set_name('name') \ + .description('This is a description') \ + .set_status('Testing').set_type('test') \ + .custom({"foo": "bar"}).sync() + + get_all_result = pubnub.get_all_channel_metadata().include_custom(True).sync() + assert_envelope_of_type(get_all_result, PNGetAllChannelMetadataResult) + + assert len(get_all_result.result.data) == 2 + assert get_all_result.result.data[0]['id'] == channel + assert get_all_result.result.data[0]['name'] == 'name' + assert get_all_result.result.data[0]['description'] == 'This is a description' + assert get_all_result.result.data[0]['custom'] == {"foo": "bar"} + assert get_all_result.result.data[0]['status'] == 'Testing' + assert get_all_result.result.data[0]['type'] == 'test' + + +@pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/metadata/remove_channel_metadata.json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk'], serializer='pn_json') +def test_remove_channel_metadata(pubnub): + channel = 'metadata_channel' + result_1 = pubnub.remove_channel_metadata().channel(channel).sync() + result_2 = pubnub.remove_channel_metadata().channel(f'{channel}-two').sync() + + get_all_result = pubnub.get_all_channel_metadata().include_custom(True).sync() + assert_envelope_of_type(result_1, PNRemoveChannelMetadataResult) + assert_envelope_of_type(result_2, PNRemoveChannelMetadataResult) + assert_envelope_of_type(get_all_result, PNGetAllChannelMetadataResult) + assert len(get_all_result.result.data) == 0 + + +@pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/metadata/set_uuid_metadata.json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk'], serializer='pn_json') +def test_set_uuid_metadata(pubnub): + uuid = 'metadata_uuid' + set_result = pubnub.set_uuid_metadata().uuid(uuid) \ + .set_name('name') \ + .external_id('externalId') \ + .profile_url('https://127.0.0.1') \ + .email('example@127.0.0.1') \ + .set_name('name') \ + .set_type('test') \ + .set_status('Testing') \ + .custom({"foo": "bar"}).sync() + + assert_envelope_of_type(set_result, PNSetUUIDMetadataResult) + assert set_result.result.data['id'] == uuid + assert set_result.result.data['name'] == 'name' + assert set_result.result.data['externalId'] == 'externalId' + assert set_result.result.data['profileUrl'] == 'https://127.0.0.1' + assert set_result.result.data['email'] == 'example@127.0.0.1' + assert set_result.result.data['custom'] == {"foo": "bar"} + assert set_result.result.data['status'] == 'Testing' + assert set_result.result.data['type'] == 'test' + + +@pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/metadata/get_uuid_metadata.json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk'], serializer='pn_json') +def test_get_uuid_metadata(pubnub): + uuid = 'metadata_uuid' + get_result = pubnub.get_uuid_metadata().uuid(uuid).include_custom(True).sync() + assert_envelope_of_type(get_result, PNGetUUIDMetadataResult) + assert get_result.result.data['id'] == uuid + assert get_result.result.data['name'] == 'name' + assert get_result.result.data['externalId'] == 'externalId' + assert get_result.result.data['profileUrl'] == 'https://127.0.0.1' + assert get_result.result.data['email'] == 'example@127.0.0.1' + assert get_result.result.data['custom'] == {"foo": "bar"} + assert get_result.result.data['status'] == 'Testing' + assert get_result.result.data['type'] == 'test' + + +@pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/metadata/get_all_uuid_metadata.json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk'], serializer='pn_json') +def test_get_all_uuid_metadata(pubnub): + uuid = 'metadata_uuid' + + pubnub.set_uuid_metadata().uuid(f'{uuid}-two') \ + .set_name('name') \ + .external_id('externalId') \ + .profile_url('https://127.0.0.1') \ + .email('example@127.0.0.1') \ + .set_name('name') \ + .set_type('test') \ + .set_status('Testing') \ + .custom({"foo": "bar"}).sync() + + get_all_result = pubnub.get_all_uuid_metadata().include_custom(True).sync() + assert_envelope_of_type(get_all_result, PNGetAllUUIDMetadataResult) + assert len(get_all_result.result.data) == 2 + assert get_all_result.result.data[0]['id'] == uuid + assert get_all_result.result.data[0]['name'] == 'name' + assert get_all_result.result.data[0]['externalId'] == 'externalId' + assert get_all_result.result.data[0]['profileUrl'] == 'https://127.0.0.1' + assert get_all_result.result.data[0]['email'] == 'example@127.0.0.1' + assert get_all_result.result.data[0]['custom'] == {"foo": "bar"} + assert get_all_result.result.data[0]['status'] == 'Testing' + assert get_all_result.result.data[0]['type'] == 'test' + + +@pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/metadata/remove_uuid_metadata.json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk'], serializer='pn_json') +def test_remove_uuid_metadata(pubnub): + uuid = 'metadata_uuid' + result_1 = pubnub.remove_uuid_metadata().uuid(uuid).sync() + result_2 = pubnub.remove_uuid_metadata().uuid(f'{uuid}-two').sync() + + get_all_result = pubnub.get_all_uuid_metadata().include_custom(True).sync() + assert_envelope_of_type(result_2, PNRemoveUUIDMetadataResult) + assert_envelope_of_type(result_1, PNRemoveUUIDMetadataResult) + assert_envelope_of_type(get_all_result, PNGetAllUUIDMetadataResult) + assert len(get_all_result.result.data) == 0 From a952b67ef5ad55c95ff0ae0826cf9d900d09f289 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Thu, 7 Mar 2024 11:50:58 +0100 Subject: [PATCH 3/4] Update all tests VCRs to include status and type fields --- .../objects_v2/channel/get_all_channel.json | 108 ++++++++++++ .../objects_v2/channel/get_all_channel.yaml | 71 -------- .../objects_v2/channel/get_channel.json | 55 ++++++ .../objects_v2/channel/get_channel.yaml | 35 ---- .../objects_v2/channel/remove_channel.json | 58 +++++++ .../objects_v2/channel/remove_channel.yaml | 36 ---- .../objects_v2/channel/set_channel.json | 58 +++++++ .../objects_v2/channel/set_channel.yaml | 38 ---- .../channel_members/get_channel_members.json | 108 ++++++++++++ .../channel_members/get_channel_members.yaml | 80 --------- .../get_channel_members_with_pagination.json | 158 +++++++++++++++++ .../get_channel_members_with_pagination.yaml | 106 ----------- .../manage_channel_members.json | 58 +++++++ .../manage_channel_members.yaml | 44 ----- .../remove_channel_members.json | 58 +++++++ .../remove_channel_members.yaml | 45 ----- .../channel_members/set_channel_members.json | 164 ++++++++++++++++++ .../channel_members/set_channel_members.yaml | 118 ------------- .../memberships/get_memberships.json | 161 +++++++++++++++++ .../memberships/get_memberships.yaml | 115 ------------ .../memberships/manage_memberships.json | 58 +++++++ .../memberships/manage_memberships.yaml | 47 ----- .../memberships/remove_memberships.json | 58 +++++++ .../memberships/remove_memberships.yaml | 46 ----- .../memberships/set_memberships.json | 164 ++++++++++++++++++ .../memberships/set_memberships.yaml | 118 ------------- .../objects_v2/uuid/get_all_uuid.json | 55 ++++++ .../objects_v2/uuid/get_all_uuid.yaml | 49 ------ .../native_sync/objects_v2/uuid/get_uuid.json | 55 ++++++ .../native_sync/objects_v2/uuid/get_uuid.yaml | 34 ---- .../objects_v2/uuid/remove_uuid.json | 58 +++++++ .../objects_v2/uuid/remove_uuid.yaml | 36 ---- .../native_sync/objects_v2/uuid/set_uuid.json | 58 +++++++ .../native_sync/objects_v2/uuid/set_uuid.yaml | 37 ---- .../native_sync/objects_v2/test_channel.py | 20 +-- .../objects_v2/test_channel_members.py | 24 +-- .../objects_v2/test_memberships.py | 20 +-- .../native_sync/objects_v2/test_uuid.py | 42 ++--- 38 files changed, 1545 insertions(+), 1108 deletions(-) create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/manage_channel_members.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/manage_channel_members.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/remove_channel_members.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/remove_channel_members.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.yaml create mode 100644 tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.json delete mode 100644 tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.yaml diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.json b/tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.json new file mode 100644 index 00000000..d15875c3 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.json @@ -0,0 +1,108 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"Some name\", \"description\": \"Some description\", \"custom\": {\"key1\": \"val1\", \"key2\": \"val2\"}}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "100" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "243" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:02 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"somechannelid\",\"name\":\"Some name\",\"description\":\"Some description\",\"type\":null,\"status\":null,\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:02.768895Z\",\"eTag\":\"02c6f5b485d41252a921200b102d2eba\"}}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels?count=True&include=custom%2Cstatus%2Ctype&limit=10&sort=id%3Aasc%2Cupdated%3Adesc", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "682" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:02 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"id\":\"somechannel\",\"name\":\"some name\",\"description\":null,\"type\":null,\"status\":null,\"custom\":null,\"updated\":\"2024-03-07T08:46:53.26682Z\",\"eTag\":\"23e310250a16a047c79a0581d3721bb8\"},{\"id\":\"somechannelid\",\"name\":\"Some name\",\"description\":\"Some description\",\"type\":null,\"status\":null,\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:02.768895Z\",\"eTag\":\"02c6f5b485d41252a921200b102d2eba\"},{\"id\":\"somechannel_with_custom\",\"name\":\"some name with custom\",\"description\":null,\"type\":null,\"status\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:46:53.467344Z\",\"eTag\":\"0e480702d320e937f400f55aa25d798c\"}],\"totalCount\":3,\"next\":\"Mw\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.yaml deleted file mode 100644 index b106c724..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.yaml +++ /dev/null @@ -1,71 +0,0 @@ -interactions: -- request: - body: '{"name": "Some name", "description": "Some description", "custom": {"key1": - "val1", "key2": "val2"}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '100' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid?include=custom - response: - body: - string: '{"status":200,"data":{"id":"somechannelid","name":"Some name","description":"Some - description","custom":{"key1":"val1","key2":"val2"},"updated":"2020-09-30T13:58:47.604494Z","eTag":"AdyzhpyljqSqHA"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '199' - Content-Type: - - application/json - Date: - - Wed, 30 Sep 2020 14:00:12 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.5.3 - method: GET - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels?count=True&include=custom&limit=10&sort=id%3Aasc%2Cupdated%3Adesc - response: - body: - string: '{"status":200,"data":[{"id":"somechannelid","name":"Some name","description":"Some - description","custom":{"key1":"val1","key2":"val2"},"updated":"2020-09-30T13:58:47.604494Z","eTag":"AdyzhpyljqSqHA"}],"totalCount":1,"next":"MQ"}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '228' - Content-Type: - - application/json - Date: - - Wed, 30 Sep 2020 14:00:12 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.json b/tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.json new file mode 100644 index 00000000..ef08552b --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.json @@ -0,0 +1,55 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid?include=custom%2Cstatus%2Ctype", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "243" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:02 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"somechannelid\",\"name\":\"Some name\",\"description\":\"Some description\",\"type\":null,\"status\":null,\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:02.114956Z\",\"eTag\":\"123ed9b124b768824b19e4bda619f476\"}}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.yaml deleted file mode 100644 index d4c57299..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.yaml +++ /dev/null @@ -1,35 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.5.3 - method: GET - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid?include=custom - response: - body: - string: '{"status":200,"data":{"id":"somechannelid","name":"Some name","description":"Some - description","custom":{"key1":"val1","key2":"val2"},"updated":"2020-09-30T12:52:14.765159Z","eTag":"AdyzhpyljqSqHA"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '199' - Content-Type: - - application/json - Date: - - Wed, 30 Sep 2020 13:14:48 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.json b/tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.json new file mode 100644 index 00000000..435d0cd9 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "DELETE", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "26" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:02 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":null}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.yaml deleted file mode 100644 index 80d57ad5..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - PubNub-Python/4.5.3 - method: DELETE - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid - response: - body: - string: '{"status":200,"data":null}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '26' - Content-Type: - - application/json - Date: - - Wed, 30 Sep 2020 13:24:53 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.json b/tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.json new file mode 100644 index 00000000..08d2da29 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"Some name\", \"description\": \"Some description\", \"custom\": {\"key1\": \"val1\", \"key2\": \"val2\"}}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "100" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "243" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:02 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"somechannelid\",\"name\":\"Some name\",\"description\":\"Some description\",\"type\":null,\"status\":null,\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:02.114956Z\",\"eTag\":\"123ed9b124b768824b19e4bda619f476\"}}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.yaml deleted file mode 100644 index e6901a64..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.yaml +++ /dev/null @@ -1,38 +0,0 @@ -interactions: -- request: - body: '{"name": "Some name", "description": "Some description", "custom": {"key1": - "val1", "key2": "val2"}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '100' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid?include=custom - response: - body: - string: '{"status":200,"data":{"id":"somechannelid","name":"Some name","description":"Some - description","custom":{"key1":"val1","key2":"val2"},"updated":"2020-09-30T12:52:14.765159Z","eTag":"AdyzhpyljqSqHA"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '199' - Content-Type: - - application/json - Date: - - Wed, 30 Sep 2020 12:54:46 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.json b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.json new file mode 100644 index 00000000..f5befd3f --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.json @@ -0,0 +1,108 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid_with_custom?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"some name with custom\", \"email\": null, \"externalId\": null, \"profileUrl\": null, \"custom\": {\"key3\": \"val1\", \"key4\": \"val2\"}}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "132" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "278" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:03 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"someuuid_with_custom\",\"name\":\"some name with custom\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"type\":null,\"status\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:47:38.835107Z\",\"eTag\":\"0f3067e0988bc7ded57f36d075b98eaf\"}}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid/uuids?include=custom%2Cuuid.custom", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "646" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:03 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"uuid\":{\"id\":\"someuuid\",\"name\":\"some name\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"custom\":null,\"updated\":\"2024-03-07T08:49:03.160451Z\",\"eTag\":\"4e310df3a9c5d0061a93ff0c572e9932\"},\"custom\":null,\"updated\":\"2024-03-07T08:47:39.889598Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"someuuid_with_custom\",\"name\":\"some name with custom\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:47:38.835107Z\",\"eTag\":\"0f3067e0988bc7ded57f36d075b98eaf\"},\"custom\":{\"key5\":\"val1\",\"key6\":\"val2\"},\"updated\":\"2024-03-07T08:49:03.56587Z\",\"eTag\":\"AaDS+bDXjNqKUA\"}],\"next\":\"Mg\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.yaml deleted file mode 100644 index 04712988..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.yaml +++ /dev/null @@ -1,80 +0,0 @@ -interactions: -- request: - body: '{"name": "some name with custom", "email": null, "externalId": null, "profileUrl": - null, "custom": {"key3": "val1", "key4": "val2"}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '132' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid_with_custom - response: - body: - string: '{"status":200,"data":{"id":"someuuid_with_custom","name":"some name - with custom","externalId":null,"profileUrl":null,"email":null,"updated":"2020-10-02T09:37:21.511049Z","eTag":"AefalozsjJrzmAE"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '196' - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 11:38:25 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.5.3 - method: GET - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid/uuids?include=custom%2Cuuid.custom - response: - body: - string: !!binary | - H4sIAAAAAAAAA5yRX0/CMBTFvwq5z2NruxZc34ghhj8+mEwTMYZUKThtt7m1ICx8dzoEwmI0xJem - 596b8+s9raA0wtgSOEHIg5kwAvhTBdYmM+AV1CeUmZb7ggep0PJQae3vHsgvI4tUqIEbTa1SHuRF - Nk+UvC/UsSK1SE7i1ZYm00dlcweVNYYggtoYtRGJUcTDrnuSz2jU6UaTGhOLhRvqvSzvTD7OF4Ob - /qQH2wvscIwpp5iHod9BlDF2bvcYRno4GgXBNXqo7X5ZfbpKzNv0gPoZQ6tut07tf0dSwYdch855 - KRR2Rk7Rb0XqVf/KCvsMY0QbWcm5UNmmfB8WG93rn4e1B7EGqHMBiGGOIp9gRghtfMp6lY7jLPjU - V3blQM8uIheCa90uYLsDAAD//wMAnBDTUmUCAAA= - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 11:38:25 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.json b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.json new file mode 100644 index 00000000..b472f415 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.json @@ -0,0 +1,158 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid/uuids", + "body": "{\"set\": [{\"uuid\": {\"id\": \"test-fix-118-0\"}}, {\"uuid\": {\"id\": \"test-fix-118-1\"}}, {\"uuid\": {\"id\": \"test-fix-118-2\"}}, {\"uuid\": {\"id\": \"test-fix-118-3\"}}, {\"uuid\": {\"id\": \"test-fix-118-4\"}}, {\"uuid\": {\"id\": \"test-fix-118-5\"}}, {\"uuid\": {\"id\": \"test-fix-118-6\"}}, {\"uuid\": {\"id\": \"test-fix-118-7\"}}, {\"uuid\": {\"id\": \"test-fix-118-8\"}}, {\"uuid\": {\"id\": \"test-fix-118-9\"}}, {\"uuid\": {\"id\": \"test-fix-118-10\"}}, {\"uuid\": {\"id\": \"test-fix-118-11\"}}, {\"uuid\": {\"id\": \"test-fix-118-12\"}}, {\"uuid\": {\"id\": \"test-fix-118-13\"}}, {\"uuid\": {\"id\": \"test-fix-118-14\"}}], \"delete\": []}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "568" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 10:45:17 GMT" + ], + "Content-Length": [ + "1494" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"uuid\":{\"id\":\"test-fix-118-0\"},\"updated\":\"2024-03-07T08:49:04.188608Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-1\"},\"updated\":\"2024-03-07T08:49:04.158265Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-10\"},\"updated\":\"2024-03-07T08:49:04.17135Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-11\"},\"updated\":\"2024-03-07T08:49:04.178519Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-12\"},\"updated\":\"2024-03-07T08:49:04.217123Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-13\"},\"updated\":\"2024-03-07T08:49:04.184258Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-14\"},\"updated\":\"2024-03-07T08:49:04.241892Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-2\"},\"updated\":\"2024-03-07T08:49:04.194158Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-3\"},\"updated\":\"2024-03-07T08:49:04.22214Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-4\"},\"updated\":\"2024-03-07T08:49:04.199295Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-5\"},\"updated\":\"2024-03-07T08:49:04.228786Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-6\"},\"updated\":\"2024-03-07T08:49:04.235126Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-7\"},\"updated\":\"2024-03-07T08:49:04.207036Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-8\"},\"updated\":\"2024-03-07T08:49:04.212662Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-9\"},\"updated\":\"2024-03-07T08:49:04.164916Z\",\"eTag\":\"AZO/t53al7m8fw\"}],\"next\":\"MTU\"}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid/uuids?limit=10", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 10:45:18 GMT" + ], + "Content-Length": [ + "1009" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"uuid\":{\"id\":\"test-fix-118-0\"},\"updated\":\"2024-03-07T08:49:04.188608Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-1\"},\"updated\":\"2024-03-07T08:49:04.158265Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-10\"},\"updated\":\"2024-03-07T08:49:04.17135Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-11\"},\"updated\":\"2024-03-07T08:49:04.178519Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-12\"},\"updated\":\"2024-03-07T08:49:04.217123Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-13\"},\"updated\":\"2024-03-07T08:49:04.184258Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-14\"},\"updated\":\"2024-03-07T08:49:04.241892Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-2\"},\"updated\":\"2024-03-07T08:49:04.194158Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-3\"},\"updated\":\"2024-03-07T08:49:04.22214Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-4\"},\"updated\":\"2024-03-07T08:49:04.199295Z\",\"eTag\":\"AZO/t53al7m8fw\"}],\"next\":\"MTA\"}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid/uuids?limit=10&start=MTA", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 10:45:20 GMT" + ], + "Content-Length": [ + "534" + ], + "Content-Type": [ + "application/json" + ], + "Connection": [ + "keep-alive" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"uuid\":{\"id\":\"test-fix-118-5\"},\"updated\":\"2024-03-07T08:49:04.228786Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-6\"},\"updated\":\"2024-03-07T08:49:04.235126Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-7\"},\"updated\":\"2024-03-07T08:49:04.207036Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-8\"},\"updated\":\"2024-03-07T08:49:04.212662Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-9\"},\"updated\":\"2024-03-07T08:49:04.164916Z\",\"eTag\":\"AZO/t53al7m8fw\"}],\"next\":\"MTU\",\"prev\":\"MTA\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.yaml deleted file mode 100644 index 8685e0b3..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.yaml +++ /dev/null @@ -1,106 +0,0 @@ -interactions: -- request: - body: '{"set": [{"uuid": {"id": "test-fix-118-0"}}, {"uuid": {"id": "test-fix-118-1"}}, - {"uuid": {"id": "test-fix-118-2"}}, {"uuid": {"id": "test-fix-118-3"}}, {"uuid": - {"id": "test-fix-118-4"}}, {"uuid": {"id": "test-fix-118-5"}}, {"uuid": {"id": - "test-fix-118-6"}}, {"uuid": {"id": "test-fix-118-7"}}, {"uuid": {"id": "test-fix-118-8"}}, - {"uuid": {"id": "test-fix-118-9"}}, {"uuid": {"id": "test-fix-118-10"}}, {"uuid": - {"id": "test-fix-118-11"}}, {"uuid": {"id": "test-fix-118-12"}}, {"uuid": {"id": - "test-fix-118-13"}}, {"uuid": {"id": "test-fix-118-14"}}], "delete": []}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '568' - User-Agent: - - PubNub-Python/6.3.0 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid/uuids - response: - body: - string: '{"status":200,"data":[{"uuid":{"id":"test-fix-118-0"},"updated":"2022-04-21T10:05:14.580127Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-1"},"updated":"2022-04-21T10:05:14.58336Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-10"},"updated":"2022-04-21T10:05:14.605349Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-11"},"updated":"2022-04-21T10:05:14.608585Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-12"},"updated":"2022-04-21T10:05:14.597527Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-13"},"updated":"2022-04-21T10:05:14.576398Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-14"},"updated":"2022-04-21T10:05:14.611731Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-2"},"updated":"2022-04-21T10:05:14.586304Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-3"},"updated":"2022-04-21T10:05:14.58986Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-4"},"updated":"2022-04-21T10:05:14.593492Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-5"},"updated":"2022-04-21T10:05:14.567831Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-6"},"updated":"2022-04-21T10:05:14.572508Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-7"},"updated":"2022-04-21T10:05:14.601774Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-8"},"updated":"2022-04-21T10:05:14.615379Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-9"},"updated":"2022-04-21T10:05:14.618906Z","eTag":"AY39mJKK//C0VA"}],"next":"MTU"}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '1494' - Content-Type: - - application/json - Date: - - Thu, 21 Apr 2022 10:31:13 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/6.3.0 - method: GET - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid/uuids?limit=10 - response: - body: - string: '{"status":200,"data":[{"uuid":{"id":"test-fix-118-0"},"updated":"2022-04-21T10:05:14.580127Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-1"},"updated":"2022-04-21T10:05:14.58336Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-10"},"updated":"2022-04-21T10:05:14.605349Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-11"},"updated":"2022-04-21T10:05:14.608585Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-12"},"updated":"2022-04-21T10:05:14.597527Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-13"},"updated":"2022-04-21T10:05:14.576398Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-14"},"updated":"2022-04-21T10:05:14.611731Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-2"},"updated":"2022-04-21T10:05:14.586304Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-3"},"updated":"2022-04-21T10:05:14.58986Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-4"},"updated":"2022-04-21T10:05:14.593492Z","eTag":"AY39mJKK//C0VA"}],"next":"MTA"}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '1009' - Content-Type: - - application/json - Date: - - Thu, 21 Apr 2022 10:31:13 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/6.3.0 - method: GET - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid/uuids?limit=10&start=MTA - response: - body: - string: '{"status":200,"data":[{"uuid":{"id":"test-fix-118-5"},"updated":"2022-04-21T10:05:14.567831Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-6"},"updated":"2022-04-21T10:05:14.572508Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-7"},"updated":"2022-04-21T10:05:14.601774Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-8"},"updated":"2022-04-21T10:05:14.615379Z","eTag":"AY39mJKK//C0VA"},{"uuid":{"id":"test-fix-118-9"},"updated":"2022-04-21T10:05:14.618906Z","eTag":"AY39mJKK//C0VA"}],"next":"MTU","prev":"MTA"}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '534' - Content-Type: - - application/json - Date: - - Thu, 21 Apr 2022 10:31:13 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/manage_channel_members.json b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/manage_channel_members.json new file mode 100644 index 00000000..91937214 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/manage_channel_members.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid/uuids?include=custom%2Cuuid.custom", + "body": "{\"set\": [{\"uuid\": {\"id\": \"someuuid\"}}], \"delete\": [{\"uuid\": {\"id\": \"someuuid_with_custom\"}}]}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "93" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "1973" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:05 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"uuid\":{\"id\":\"someuuid\",\"name\":\"some name\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"custom\":null,\"updated\":\"2024-03-07T08:49:03.160451Z\",\"eTag\":\"4e310df3a9c5d0061a93ff0c572e9932\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:05.020764Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-0\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.188608Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-1\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.158265Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-10\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.17135Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-11\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.178519Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-12\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.217123Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-13\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.184258Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-14\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.241892Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-2\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.194158Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-3\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.22214Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-4\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.199295Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-5\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.228786Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-6\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.235126Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-7\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.207036Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-8\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.212662Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-9\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.164916Z\",\"eTag\":\"AZO/t53al7m8fw\"}],\"next\":\"MTY\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/manage_channel_members.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/manage_channel_members.yaml deleted file mode 100644 index f1324ce8..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/manage_channel_members.yaml +++ /dev/null @@ -1,44 +0,0 @@ -interactions: -- request: - body: '{"set": [{"uuid": {"id": "someuuid"}}], "delete": [{"uuid": {"id": "someuuid_with_custom"}}]}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '93' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid/uuids?include=custom%2Cuuid.custom - response: - body: - string: !!binary | - H4sIAAAAAAAAA4xPTQuCQBT8K/HOWs81jd2bRIR9HIQKMjpsuYmwq6K7EUj/vVUqOnZ5vJk3zLzp - oNVcmxYYQXQg45oDO3VgTJEB66Cf0FZKDIQDJVfizYyG3QHx0KIpuYyttDRSOlA31a2QYt/IDyMU - L77galpdqQ8ytQ0VfQxBgq6HLpIdUubP7EvjYErDGU37mB3PrSi63BNdb+o8Xi7SCJ5/2XlTRgJG - /DGG1A+8X7ujT9VqvZ5M5niwdmdb0Rayl20CzxcAAAD//wMAlqSSoB4BAAA= - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 14:26:35 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/remove_channel_members.json b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/remove_channel_members.json new file mode 100644 index 00000000..3c139a44 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/remove_channel_members.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid/uuids?include=custom%2Cuuid.custom", + "body": "{\"set\": [], \"delete\": [{\"uuid\": {\"id\": \"someuuid\"}}]}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "53" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "2046" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:04 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"uuid\":{\"id\":\"someuuid_with_custom\",\"name\":\"some name with custom\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:47:38.835107Z\",\"eTag\":\"0f3067e0988bc7ded57f36d075b98eaf\"},\"custom\":{\"key5\":\"val1\",\"key6\":\"val2\"},\"updated\":\"2024-03-07T08:49:03.56587Z\",\"eTag\":\"AaDS+bDXjNqKUA\"},{\"uuid\":{\"id\":\"test-fix-118-0\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.188608Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-1\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.158265Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-10\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.17135Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-11\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.178519Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-12\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.217123Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-13\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.184258Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-14\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.241892Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-2\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.194158Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-3\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.22214Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-4\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.199295Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-5\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.228786Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-6\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.235126Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-7\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.207036Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-8\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.212662Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"test-fix-118-9\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:04.164916Z\",\"eTag\":\"AZO/t53al7m8fw\"}],\"next\":\"MTY\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/remove_channel_members.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/remove_channel_members.yaml deleted file mode 100644 index 7c14d5e7..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/remove_channel_members.yaml +++ /dev/null @@ -1,45 +0,0 @@ -interactions: -- request: - body: '{"set": [], "delete": [{"uuid": {"id": "someuuid"}}]}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '53' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid/uuids?include=custom%2Cuuid.custom - response: - body: - string: !!binary | - H4sIAAAAAAAAA4yQQU/DMAyF/0rlczcSrwWa2w4chtgBqVxAaDIsg7Kk2ZqEslX77zhiTOzGJfLz - c95neQAfKEQPCoXIYUmBQD0NEGOzBDVAesE7q1Nj0TfhffEafXAWcmjJ6qObpTpLdnay9VfQXUtm - xhFtNCaHTedWjdEPnfntaEvNSRx/MnWtdxNO/iQjOYhV8aMQDjnEDW+p014oUIykGAmsRaUmVwrl - uJRSFNVj4tf0xkNTvSLj9v7jttvb6U1KOAOVZ6DLf4BKqUQ1RlkiFn9BL7u+vavdxdZex55Bz3wi - PgJb83s4fAMAAP//AwCchNwWagEAAA== - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 11:59:19 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.json b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.json new file mode 100644 index 00000000..089d60e8 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.json @@ -0,0 +1,164 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid?include=status%2Ctype", + "body": "{\"name\": \"some name\", \"email\": null, \"externalId\": null, \"profileUrl\": null, \"custom\": null}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "92" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "215" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:03 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"someuuid\",\"name\":\"some name\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"type\":null,\"status\":null,\"updated\":\"2024-03-07T08:49:03.160451Z\",\"eTag\":\"4e310df3a9c5d0061a93ff0c572e9932\"}}" + } + } + }, + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid_with_custom?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"some name with custom\", \"email\": null, \"externalId\": null, \"profileUrl\": null, \"custom\": {\"key3\": \"val1\", \"key4\": \"val2\"}}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "132" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "278" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:03 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"someuuid_with_custom\",\"name\":\"some name with custom\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"type\":null,\"status\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:47:38.835107Z\",\"eTag\":\"0f3067e0988bc7ded57f36d075b98eaf\"}}" + } + } + }, + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannelid/uuids?include=custom%2Cuuid.custom", + "body": "{\"set\": [{\"uuid\": {\"id\": \"someuuid\"}}, {\"uuid\": {\"id\": \"someuuid_with_custom\"}, \"custom\": {\"key5\": \"val1\", \"key6\": \"val2\"}}], \"delete\": []}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "139" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "646" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:03 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"uuid\":{\"id\":\"someuuid\",\"name\":\"some name\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"custom\":null,\"updated\":\"2024-03-07T08:49:03.160451Z\",\"eTag\":\"4e310df3a9c5d0061a93ff0c572e9932\"},\"custom\":null,\"updated\":\"2024-03-07T08:47:39.889598Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"uuid\":{\"id\":\"someuuid_with_custom\",\"name\":\"some name with custom\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:47:38.835107Z\",\"eTag\":\"0f3067e0988bc7ded57f36d075b98eaf\"},\"custom\":{\"key5\":\"val1\",\"key6\":\"val2\"},\"updated\":\"2024-03-07T08:49:03.56587Z\",\"eTag\":\"AaDS+bDXjNqKUA\"}],\"next\":\"Mg\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.yaml b/tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.yaml deleted file mode 100644 index bb689a4d..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.yaml +++ /dev/null @@ -1,118 +0,0 @@ -interactions: -- request: - body: '{"name": "some name", "email": null, "externalId": null, "profileUrl": - null, "custom": null}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '92' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid - response: - body: - string: '{"status":200,"data":{"id":"someuuid","name":"some name","externalId":null,"profileUrl":null,"email":null,"updated":"2020-10-02T09:37:20.549679Z","eTag":"AbvQtpLpgIGEZA"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '171' - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 11:28:59 GMT - status: - code: 200 - message: OK -- request: - body: '{"name": "some name with custom", "email": null, "externalId": null, "profileUrl": - null, "custom": {"key3": "val1", "key4": "val2"}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '132' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid_with_custom - response: - body: - string: '{"status":200,"data":{"id":"someuuid_with_custom","name":"some name - with custom","externalId":null,"profileUrl":null,"email":null,"updated":"2020-10-02T09:37:21.511049Z","eTag":"AefalozsjJrzmAE"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '196' - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 11:29:00 GMT - status: - code: 200 - message: OK -- request: - body: '{"set": [{"uuid": {"id": "someuuid"}}, {"uuid": {"id": "someuuid_with_custom"}, - "custom": {"key5": "val1", "key6": "val2"}}], "delete": []}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '139' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannelid/uuids?include=custom%2Cuuid.custom - response: - body: - string: !!binary | - H4sIAAAAAAAAA5yRX0/CMBTFvwq5z2NruxZc34ghhj8+mEwTMYZUKThtt7m1ICx8dzoEwmI0xJem - 596b8+s9raA0wtgSOEHIg5kwAvhTBdYmM+AV1CeUmZb7ggep0PJQae3vHsgvI4tUqIEbTa1SHuRF - Nk+UvC/UsSK1SE7i1ZYm00dlcweVNYYggtoYtRGJUcTDrnuSz2jU6UaTGhOLhRvqvSzvTD7OF4Ob - /qQH2wvscIwpp5iHod9BlDF2bvcYRno4GgXBNXqo7X5ZfbpKzNv0gPoZQ6tut07tf0dSwYdch855 - KRR2Rk7Rb0XqVf/KCvsMY0QbWcm5UNmmfB8WG93rn4e1B7EGqHMBiGGOIp9gRghtfMp6lY7jLPjU - V3blQM8uIheCa90uYLsDAAD//wMAnBDTUmUCAAA= - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 11:29:01 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.json b/tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.json new file mode 100644 index 00000000..c92c9174 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.json @@ -0,0 +1,161 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannel?include=status%2Ctype", + "body": "{\"name\": \"some name\", \"description\": null, \"custom\": null}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "58" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "187" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:05 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"somechannel\",\"name\":\"some name\",\"description\":null,\"type\":null,\"status\":null,\"updated\":\"2024-03-07T08:46:53.26682Z\",\"eTag\":\"23e310250a16a047c79a0581d3721bb8\"}}" + } + } + }, + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannel_with_custom?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"some name with custom\", \"description\": null, \"custom\": {\"key3\": \"val1\", \"key4\": \"val2\"}}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "98" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "251" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:06 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"somechannel_with_custom\",\"name\":\"some name with custom\",\"description\":null,\"type\":null,\"status\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:46:53.467344Z\",\"eTag\":\"0e480702d320e937f400f55aa25d798c\"}}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid/channels?include=custom%2Cchannel.custom", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "884" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:06 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"channel\":{\"id\":\"somechannel\",\"name\":\"some name\",\"description\":null,\"custom\":null,\"updated\":\"2024-03-07T08:46:53.26682Z\",\"eTag\":\"23e310250a16a047c79a0581d3721bb8\"},\"custom\":null,\"updated\":\"2024-03-07T08:47:41.667671Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"channel\":{\"id\":\"somechannelid\",\"name\":\"Some name\",\"description\":\"Some description\",\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:02.768895Z\",\"eTag\":\"02c6f5b485d41252a921200b102d2eba\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:05.020764Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"channel\":{\"id\":\"somechannel_with_custom\",\"name\":\"some name with custom\",\"description\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:46:53.467344Z\",\"eTag\":\"0e480702d320e937f400f55aa25d798c\"},\"custom\":{\"key5\":\"val1\",\"key6\":\"val2\"},\"updated\":\"2024-03-07T08:49:05.785245Z\",\"eTag\":\"AaDS+bDXjNqKUA\"}],\"next\":\"Mw\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.yaml b/tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.yaml deleted file mode 100644 index 8431da2f..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.yaml +++ /dev/null @@ -1,115 +0,0 @@ -interactions: -- request: - body: '{"name": "some name", "description": null, "custom": null}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '58' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannel - response: - body: - string: '{"status":200,"data":{"id":"somechannel","name":"some name","description":null,"updated":"2020-10-02T16:42:52.805737Z","eTag":"Ac7cyYSP3pe7Kg"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '144' - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 17:38:21 GMT - status: - code: 200 - message: OK -- request: - body: '{"name": "some name with custom", "description": null, "custom": {"key3": - "val1", "key4": "val2"}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '98' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannel_with_custom - response: - body: - string: '{"status":200,"data":{"id":"somechannel_with_custom","name":"some name - with custom","description":null,"updated":"2020-10-02T16:42:53.762086Z","eTag":"AcK6vsPkgvuhcA"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '168' - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 17:38:22 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.5.3 - method: GET - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid/channels?include=custom%2Cchannel.custom - response: - body: - string: !!binary | - H4sIAAAAAAAAA5xSa0vDMBT9KyOfty7vNPfbGAOxIoJFmCKjdrEr62PaZnMU/7vZS1bUbfgtJzf3 - nJxzb4OqOqpthYBi3EXTqI4QPDUonkVFYTIEDUqnCFBV5uZw10VFlJv9ZWd7dp2mit/TRZ2WBYLC - ZlkXxbaqy/yA7MKRmw0XxRT3CO5hGhIJnIKgno+FYurREZkwStyjQazi9fj+ji2MChL0eSmdICCk - 5yvJuX9MN2Y6vw6Cfn+IHwaO7qRFhw8md2on3DVobtbE9S+jjLg2h+gO0c2vf/0n1sAFYOlJjTlt - 2X4NQj0eXmmeDnEyutQ3ByqAMg9LzQT5t+/JKq1nk73gzzF3NuXOd/lcKKwVCj8Xyn4XmKckxb5s - 7UIgl9XdPFnaWTw4zmSrI1o68qyOAoZB+E5HEaqPdV7Wq+ImLPtvuW9Xoz/TstYdL5yMBEaAukn7 - XItTG/ns8jYftavcOvQFAAD//wMAci33eJgDAAA= - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 17:38:22 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.json b/tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.json new file mode 100644 index 00000000..06ad460d --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid/channels?include=custom%2Cchannel.custom", + "body": "{\"set\": [{\"channel\": {\"id\": \"somechannel\"}}], \"delete\": [{\"channel\": {\"id\": \"somechannel_with_custom\"}}]}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "105" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "565" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:06 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"channel\":{\"id\":\"somechannel\",\"name\":\"some name\",\"description\":null,\"custom\":null,\"updated\":\"2024-03-07T08:46:53.26682Z\",\"eTag\":\"23e310250a16a047c79a0581d3721bb8\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:06.800424Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"channel\":{\"id\":\"somechannelid\",\"name\":\"Some name\",\"description\":\"Some description\",\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:02.768895Z\",\"eTag\":\"02c6f5b485d41252a921200b102d2eba\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:05.020764Z\",\"eTag\":\"AZO/t53al7m8fw\"}],\"next\":\"Mg\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.yaml b/tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.yaml deleted file mode 100644 index 0273780d..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.yaml +++ /dev/null @@ -1,47 +0,0 @@ -interactions: -- request: - body: '{"set": [{"channel": {"id": "somechannel"}}], "delete": [{"channel": {"id": - "somechannel_with_custom"}}]}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '105' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid/channels?include=custom%2Cchannel.custom - response: - body: - string: !!binary | - H4sIAAAAAAAAA5xQTUvDQBD9KzLnNp2dzSbduZUiiEEQLEKUHpZ0rcEkLWajltD/7tRaUJBQvM2b - 2fe1PbTBha4FJsQRrFxwwI89FM+uaXwF3EO5AoZ2U/vTbgSNq/338uJrFqZvi9dyG8pNA9x0VTWC - omvDpj6hbivi/qBFSDhWOEZaqIRjYkPRFE2q0wcR8gu3lkezIi12+d2t3vo0W8P+PLmUTcImjTRZ - rdRPuVzb+jrLJpM53s9EbrCi4FPJo9tAux5e/E4J/81VSmiC6IjokPrPnGg5NoxJlFiM6Vftp2xh - 8/mVjcs5ri/P7R0zGSYdYWK1+UfvrpPxTK+EtWKS7NPYmumA11L+0H8Eudy8w/4TAAD//wMA4eOR - T2oCAAA= - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 17:56:57 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.json b/tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.json new file mode 100644 index 00000000..9e6faaa1 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid/channels?include=custom%2Cchannel.custom", + "body": "{\"set\": [], \"delete\": [{\"channel\": {\"id\": \"somechannel\"}}]}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "59" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "640" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:06 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"channel\":{\"id\":\"somechannelid\",\"name\":\"Some name\",\"description\":\"Some description\",\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:02.768895Z\",\"eTag\":\"02c6f5b485d41252a921200b102d2eba\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:05.020764Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"channel\":{\"id\":\"somechannel_with_custom\",\"name\":\"some name with custom\",\"description\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:46:53.467344Z\",\"eTag\":\"0e480702d320e937f400f55aa25d798c\"},\"custom\":{\"key5\":\"val1\",\"key6\":\"val2\"},\"updated\":\"2024-03-07T08:49:05.785245Z\",\"eTag\":\"AaDS+bDXjNqKUA\"}],\"next\":\"Mg\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.yaml b/tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.yaml deleted file mode 100644 index c44cf585..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.yaml +++ /dev/null @@ -1,46 +0,0 @@ -interactions: -- request: - body: '{"set": [], "delete": [{"channel": {"id": "somechannel"}}]}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '59' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid/channels?include=custom%2Cchannel.custom - response: - body: - string: !!binary | - H4sIAAAAAAAAA4yRWWvCQBSF/4rMs8vsydw3EaE0LfQhFGwRmcapBrPYZsZUxP/eiUuJ0Grf7jLn - fMy5O1RZbV2FgGLcRXNtNYLXHUqWuihMhmCH0jkCVJW5Oc1830WFzg2CwmWZF5kq+UzXNi2L8yhx - lS3zRr0yW+L1G50RL/MdPXYU7bvIrT3QNP4UU9wjuIdpjBVwAVj2pcKcBi9eZmK98I+G71GsJqM7 - xdMRXowbhzPoiP3Vj3CgAijrY6mYIG2/CVP5fRQNBiP8PPR2V/89q1O7nJ2A5wQODzpN3WnWnZ/1 - rVDYRSj8VihEAqcgWD+QFIey/YkkkpvqabXYuGUybGdy4IgLjrzJCYBhEKHnBISqNudtWxcPcTn4 - yENXj/9Myzlf/vMyEhgB6i8dciXCK5eZ+rzNl/WbxxrtvwEAAP//AwDIvXqatQIAAA== - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 17:45:38 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.json b/tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.json new file mode 100644 index 00000000..8a4842f2 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.json @@ -0,0 +1,164 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannel?include=status%2Ctype", + "body": "{\"name\": \"some name\", \"description\": null, \"custom\": null}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "58" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "187" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:05 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"somechannel\",\"name\":\"some name\",\"description\":null,\"type\":null,\"status\":null,\"updated\":\"2024-03-07T08:46:53.26682Z\",\"eTag\":\"23e310250a16a047c79a0581d3721bb8\"}}" + } + } + }, + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/channels/somechannel_with_custom?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"some name with custom\", \"description\": null, \"custom\": {\"key3\": \"val1\", \"key4\": \"val2\"}}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "98" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "251" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:05 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"somechannel_with_custom\",\"name\":\"some name with custom\",\"description\":null,\"type\":null,\"status\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:46:53.467344Z\",\"eTag\":\"0e480702d320e937f400f55aa25d798c\"}}" + } + } + }, + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid/channels?include=custom%2Cchannel.custom", + "body": "{\"set\": [{\"channel\": {\"id\": \"somechannel\"}}, {\"channel\": {\"id\": \"somechannel_with_custom\"}, \"custom\": {\"key5\": \"val1\", \"key6\": \"val2\"}}], \"delete\": []}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "151" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "884" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:05 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"channel\":{\"id\":\"somechannel\",\"name\":\"some name\",\"description\":null,\"custom\":null,\"updated\":\"2024-03-07T08:46:53.26682Z\",\"eTag\":\"23e310250a16a047c79a0581d3721bb8\"},\"custom\":null,\"updated\":\"2024-03-07T08:47:41.667671Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"channel\":{\"id\":\"somechannelid\",\"name\":\"Some name\",\"description\":\"Some description\",\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:02.768895Z\",\"eTag\":\"02c6f5b485d41252a921200b102d2eba\"},\"custom\":null,\"updated\":\"2024-03-07T08:49:05.020764Z\",\"eTag\":\"AZO/t53al7m8fw\"},{\"channel\":{\"id\":\"somechannel_with_custom\",\"name\":\"some name with custom\",\"description\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:46:53.467344Z\",\"eTag\":\"0e480702d320e937f400f55aa25d798c\"},\"custom\":{\"key5\":\"val1\",\"key6\":\"val2\"},\"updated\":\"2024-03-07T08:49:05.785245Z\",\"eTag\":\"AaDS+bDXjNqKUA\"}],\"next\":\"Mw\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.yaml b/tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.yaml deleted file mode 100644 index 16a30f31..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.yaml +++ /dev/null @@ -1,118 +0,0 @@ -interactions: -- request: - body: '{"name": "some name", "description": null, "custom": null}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '58' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannel - response: - body: - string: '{"status":200,"data":{"id":"somechannel","name":"some name","description":null,"updated":"2020-10-02T16:42:52.805737Z","eTag":"Ac7cyYSP3pe7Kg"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '144' - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 17:31:20 GMT - status: - code: 200 - message: OK -- request: - body: '{"name": "some name with custom", "description": null, "custom": {"key3": - "val1", "key4": "val2"}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '98' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channels/somechannel_with_custom - response: - body: - string: '{"status":200,"data":{"id":"somechannel_with_custom","name":"some name - with custom","description":null,"updated":"2020-10-02T16:42:53.762086Z","eTag":"AcK6vsPkgvuhcA"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '168' - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 17:31:21 GMT - status: - code: 200 - message: OK -- request: - body: '{"set": [{"channel": {"id": "somechannel"}}, {"channel": {"id": "somechannel_with_custom"}, - "custom": {"key5": "val1", "key6": "val2"}}], "delete": []}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '151' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid/channels?include=custom%2Cchannel.custom - response: - body: - string: !!binary | - H4sIAAAAAAAAA5xSa0vDMBT9KyOfty7vNPfbGAOxIoJFmCKjdrEr62PaZnMU/7vZS1bUbfgtJzf3 - nJxzb4OqOqpthYBi3EXTqI4QPDUonkVFYTIEDUqnCFBV5uZw10VFlJv9ZWd7dp2mit/TRZ2WBYLC - ZlkXxbaqy/yA7MKRmw0XxRT3CO5hGhIJnIKgno+FYurREZkwStyjQazi9fj+ji2MChL0eSmdICCk - 5yvJuX9MN2Y6vw6Cfn+IHwaO7qRFhw8md2on3DVobtbE9S+jjLg2h+gO0c2vf/0n1sAFYOlJjTlt - 2X4NQj0eXmmeDnEyutQ3ByqAMg9LzQT5t+/JKq1nk73gzzF3NuXOd/lcKKwVCj8Xyn4XmKckxb5s - 7UIgl9XdPFnaWTw4zmSrI1o68qyOAoZB+E5HEaqPdV7Wq+ImLPtvuW9Xoz/TstYdL5yMBEaAukn7 - XItTG/ns8jYftavcOvQFAAD//wMAci33eJgDAAA= - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Fri, 02 Oct 2020 17:31:22 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.json b/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.json new file mode 100644 index 00000000..3895b3e3 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.json @@ -0,0 +1,55 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids?count=True&include=custom%2Cstatus%2Ctype&limit=10&sort=id%3Aasc%2Cupdated%3Adesc", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "307" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:07 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"id\":\"someuuid_with_custom\",\"name\":\"some name with custom\",\"externalId\":null,\"profileUrl\":null,\"email\":null,\"type\":null,\"status\":null,\"custom\":{\"key3\":\"val1\",\"key4\":\"val2\"},\"updated\":\"2024-03-07T08:47:38.835107Z\",\"eTag\":\"0f3067e0988bc7ded57f36d075b98eaf\"}],\"totalCount\":1,\"next\":\"MQ\"}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.yaml b/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.yaml deleted file mode 100644 index 74333d79..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.yaml +++ /dev/null @@ -1,49 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.5.3 - method: GET - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids?count=True&include=custom&limit=10&sort=id%3Aasc%2Cupdated%3Adesc - response: - body: - string: !!binary | - H4sIAAAAAAAAA8yVuXLcMAyG34VtljIBELyqpEzvNEnFA4o90do7Xm3GGY/fPdAkTTqlUyGNcFDQ - px8g38x1revtago6dzKjrtWUb2/mcZhiyNHsakrWx8TWh9FtrsNbzNJwxO5DAnMyT/UspjzdluVk - 5HWVl6e6fN7WA5LX+OXleX5c5MvLor6Hdb2Uuzt5refLIlN/PmuGnOvjFlzlun78N9Rv11Ufypv5 - Ib9Ac37WZSuqFv6x0LyfzO2iny5bUXTorMsW+R58QS7EU8yRmL9ule7rd036NAv75w/eSWB1vJ/+ - EnNLiZGG1Uus9yI29cwW08jkpPco8eDEwMXniR05zDuIQ+4co66eKyoxiVdi6BaYOkNnYcmHJsbC - oQBNEIED7CEe0nNkb3vF2Xqeh61IzaY0u+gJOiR3aGLaNGY3gUeiPcBq+07BUgoqseRq2yZ2GD6F - HCBh9YcG1jEOhVVigOj3SJzEO55V0xxId6/ekm2Uqs2gczwDZgjp0MTa1LEwTp6CQ9xB3KRSQ18t - uaRNXQfaVEe1M2X2oD6gfmhi3bh0jHGKAVOOO4h74FglZRv7iHo4tWEba3+z/gcgx3EeRz+cIBWk - yQVtyD1z3Cu54YPCNn2LV6VtzXPUWwwCsWFu9L/EvwEAAP//orOPjUxABZeZsaEBMVGcYmpiamxg - nqibmmZuDIxiYL1smQhM4yYGhomGKcbJqalmRoPaw8BsbGJlYgSMYgsTS3ztj1gdpZL8ksQc5/zS - vBIlK0NDoK+AXgGq9A1xVKoFAAAA//8DADSKwcGmCQAA - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Tue, 29 Sep 2020 13:30:11 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.json b/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.json new file mode 100644 index 00000000..739d92a8 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.json @@ -0,0 +1,55 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid?include=custom%2Cstatus%2Ctype", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "286" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:07 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"someuuid\",\"name\":\"Some name\",\"externalId\":\"1234\",\"profileUrl\":\"http://example.com\",\"email\":\"test@example.com\",\"type\":null,\"status\":null,\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:07.011608Z\",\"eTag\":\"58f1aa12fc7b39025d4b159aa5289854\"}}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.yaml b/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.yaml deleted file mode 100644 index e16abbe4..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.yaml +++ /dev/null @@ -1,34 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.5.3 - method: GET - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid?include=custom - response: - body: - string: '{"status":200,"data":{"id":"someuuid","name":"Some name","externalId":"1234","profileUrl":"http://example.com","email":"test@example.com","custom":{"key1":"val1","key2":"val2"},"updated":"2020-09-25T14:41:57.579119Z","eTag":"AYTuwrO3kvz6tAE"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '243' - Content-Type: - - application/json - Date: - - Mon, 28 Sep 2020 11:41:35 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.json b/tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.json new file mode 100644 index 00000000..eef3b38a --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "DELETE", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "26" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:07 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":null}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.yaml b/tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.yaml deleted file mode 100644 index ca789e73..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - PubNub-Python/4.5.3 - method: DELETE - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid - response: - body: - string: '{"status":200,"data":null}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '26' - Content-Type: - - application/json - Date: - - Mon, 28 Sep 2020 13:16:50 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.json b/tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.json new file mode 100644 index 00000000..b513bcd1 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "PATCH", + "uri": "https://ps.pndsn.com/v2/objects/{PN_KEY_SUBSCRIBE}/uuids/someuuid?include=custom%2Cstatus%2Ctype", + "body": "{\"name\": \"Some name\", \"email\": \"test@example.com\", \"externalId\": \"1234\", \"profileUrl\": \"http://example.com\", \"custom\": {\"key1\": \"val1\", \"key2\": \"val2\"}}", + "headers": { + "User-Agent": [ + "PubNub-Python/7.4.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "152" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Origin": [ + "*" + ], + "Content-Length": [ + "286" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Date": [ + "Thu, 07 Mar 2024 08:49:07 GMT" + ], + "Connection": [ + "keep-alive" + ], + "Content-Type": [ + "application/json" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"someuuid\",\"name\":\"Some name\",\"externalId\":\"1234\",\"profileUrl\":\"http://example.com\",\"email\":\"test@example.com\",\"type\":null,\"status\":null,\"custom\":{\"key1\":\"val1\",\"key2\":\"val2\"},\"updated\":\"2024-03-07T08:49:07.011608Z\",\"eTag\":\"58f1aa12fc7b39025d4b159aa5289854\"}}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.yaml b/tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.yaml deleted file mode 100644 index 16791506..00000000 --- a/tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.yaml +++ /dev/null @@ -1,37 +0,0 @@ -interactions: -- request: - body: '{"name": "Some name", "email": "test@example.com", "externalId": "1234", - "profileUrl": "http://example.com", "custom": {"key1": "val1", "key2": "val2"}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '152' - User-Agent: - - PubNub-Python/4.5.3 - method: PATCH - uri: https://ps.pndsn.com/v2/objects/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/uuids/someuuid?include=custom - response: - body: - string: '{"status":200,"data":{"id":"someuuid","name":"Some name","externalId":"1234","profileUrl":"http://example.com","email":"test@example.com","custom":{"key1":"val1","key2":"val2"},"updated":"2020-09-25T14:41:57.579119Z","eTag":"AYTuwrO3kvz6tAE"}}' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '243' - Content-Type: - - application/json - Date: - - Mon, 28 Sep 2020 11:29:04 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/native_sync/objects_v2/test_channel.py b/tests/integrational/native_sync/objects_v2/test_channel.py index 66b83f93..b92f624b 100644 --- a/tests/integrational/native_sync/objects_v2/test_channel.py +++ b/tests/integrational/native_sync/objects_v2/test_channel.py @@ -9,12 +9,12 @@ from pubnub.models.consumer.objects_v2.sort import PNSortKey, PNSortKeyValue from pubnub.pubnub import PubNub from pubnub.structures import Envelope -from tests.helper import pnconf_copy +from tests.helper import pnconf_env_copy from tests.integrational.vcr_helper import pn_vcr def _pubnub(): - config = pnconf_copy() + config = pnconf_env_copy() return PubNub(config) @@ -40,8 +40,8 @@ def test_set_channel_is_endpoint(self): assert isinstance(set_channel, SetChannel) assert isinstance(set_channel, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel/set_channel.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_set_channel_happy_path(self): pn = _pubnub() @@ -76,8 +76,8 @@ def test_get_channel_is_endpoint(self): assert isinstance(get_channel, GetChannel) assert isinstance(get_channel, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel/get_channel.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_get_channel_happy_path(self): pn = _pubnub() @@ -109,8 +109,8 @@ def test_remove_channel_is_endpoint(self): assert isinstance(remove_channel, RemoveChannel) assert isinstance(remove_channel, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel/remove_channel.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_remove_channel_happy_path(self): pn = _pubnub() @@ -136,8 +136,8 @@ def test_get_all_channel_is_endpoint(self): assert isinstance(get_all_channel, GetAllChannels) assert isinstance(get_all_channel, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel/get_all_channel.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_get_all_channel_happy_path(self): pn = _pubnub() diff --git a/tests/integrational/native_sync/objects_v2/test_channel_members.py b/tests/integrational/native_sync/objects_v2/test_channel_members.py index b88aa06e..23bc6c87 100644 --- a/tests/integrational/native_sync/objects_v2/test_channel_members.py +++ b/tests/integrational/native_sync/objects_v2/test_channel_members.py @@ -10,12 +10,12 @@ from pubnub.models.consumer.objects_v2.page import PNPage from pubnub.pubnub import PubNub from pubnub.structures import Envelope -from tests.helper import pnconf_copy +from tests.helper import pnconf_env_copy from tests.integrational.vcr_helper import pn_vcr def _pubnub(): - config = pnconf_copy() + config = pnconf_env_copy() return PubNub(config) @@ -33,8 +33,8 @@ def test_set_channel_members_is_endpoint(self): assert isinstance(set_channel_members, SetChannelMembers) assert isinstance(set_channel_members, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel_members/set_channel_members.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_set_channel_members_happy_path(self): pn = _pubnub() @@ -93,8 +93,8 @@ def test_get_channel_members_is_endpoint(self): assert isinstance(get_channel_members, GetChannelMembers) assert isinstance(get_channel_members, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_get_channel_members_happy_path(self): pn = _pubnub() @@ -133,8 +133,8 @@ def test_get_channel_members_happy_path(self): assert len([e for e in data if e['custom'] == custom_2]) != 0 @pn_vcr.use_cassette( - 'tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + 'tests/integrational/fixtures/native_sync/objects_v2/channel_members/get_channel_members_with_pagination.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_get_channel_members_with_pagination(self): pn = _pubnub() @@ -183,8 +183,8 @@ def test_remove_channel_members_is_endpoint(self): assert isinstance(remove_channel_members, Endpoint) @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel_members/' - 'remove_channel_members.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + 'remove_channel_members.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_remove_channel_members_happy_path(self): pn = _pubnub() @@ -220,8 +220,8 @@ def test_manage_channel_members_is_endpoint(self): assert isinstance(manage_channel_members, Endpoint) @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/channel_members/' - 'manage_channel_members.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + 'manage_channel_members.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_manage_channel_members_happy_path(self): pn = _pubnub() diff --git a/tests/integrational/native_sync/objects_v2/test_memberships.py b/tests/integrational/native_sync/objects_v2/test_memberships.py index 786b08ce..54d84839 100644 --- a/tests/integrational/native_sync/objects_v2/test_memberships.py +++ b/tests/integrational/native_sync/objects_v2/test_memberships.py @@ -9,12 +9,12 @@ PNGetMembershipsResult, PNRemoveMembershipsResult, PNManageMembershipsResult from pubnub.pubnub import PubNub from pubnub.structures import Envelope -from tests.helper import pnconf_copy +from tests.helper import pnconf_env_copy from tests.integrational.vcr_helper import pn_vcr def _pubnub(): - config = pnconf_copy() + config = pnconf_env_copy() return PubNub(config) @@ -32,8 +32,8 @@ def test_set_memberships_is_endpoint(self): assert isinstance(set_memberships, SetMemberships) assert isinstance(set_memberships, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/memberships/set_memberships.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_set_memberships_happy_path(self): pn = _pubnub() @@ -94,8 +94,8 @@ def test_get_memberships_is_endpoint(self): assert isinstance(get_memberships, GetMemberships) assert isinstance(get_memberships, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/memberships/get_memberships.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_get_memberships_happy_path(self): pn = _pubnub() @@ -150,8 +150,8 @@ def test_remove_memberships_is_endpoint(self): assert isinstance(remove_memberships, RemoveMemberships) assert isinstance(remove_memberships, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/memberships/remove_memberships.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_remove_memberships_happy_path(self): pn = _pubnub() @@ -186,8 +186,8 @@ def test_manage_memberships_is_endpoint(self): assert isinstance(manage_memberships, ManageMemberships) assert isinstance(manage_memberships, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/memberships/manage_memberships.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_manage_memberships_happy_path(self): pn = _pubnub() diff --git a/tests/integrational/native_sync/objects_v2/test_uuid.py b/tests/integrational/native_sync/objects_v2/test_uuid.py index 38496f06..1f78f32d 100644 --- a/tests/integrational/native_sync/objects_v2/test_uuid.py +++ b/tests/integrational/native_sync/objects_v2/test_uuid.py @@ -9,7 +9,7 @@ PNRemoveUUIDMetadataResult, PNGetAllUUIDMetadataResult from pubnub.pubnub import PubNub from pubnub.structures import Envelope -from tests.helper import pnconf_copy +from tests.helper import pnconf_env_copy from tests.integrational.vcr_helper import pn_vcr @@ -25,7 +25,7 @@ class TestObjectsV2UUID: } def test_set_uuid_endpoint_available(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) set_uuid = pn.set_uuid_metadata() assert set_uuid is not None @@ -33,16 +33,16 @@ def test_set_uuid_endpoint_available(self): assert isinstance(set_uuid, Endpoint) def test_set_uuid_is_endpoint(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) set_uuid = pn.set_uuid_metadata() assert isinstance(set_uuid, SetUuid) assert isinstance(set_uuid, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/uuid/set_uuid.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_set_uuid_happy_path(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) set_uuid_result = pn.set_uuid_metadata() \ @@ -67,7 +67,7 @@ def test_set_uuid_happy_path(self): assert data['custom'] == TestObjectsV2UUID._some_custom def test_get_uuid_endpoint_available(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) get_uuid = pn.get_uuid_metadata() assert get_uuid is not None @@ -75,16 +75,16 @@ def test_get_uuid_endpoint_available(self): assert isinstance(get_uuid, Endpoint) def test_get_uuid_is_endpoint(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) get_uuid = pn.get_uuid_metadata() assert isinstance(get_uuid, GetUuid) assert isinstance(get_uuid, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/uuid/get_uuid.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_get_uuid_happy_path(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) get_uuid_result = pn.get_uuid_metadata() \ @@ -104,7 +104,7 @@ def test_get_uuid_happy_path(self): assert data['custom'] == TestObjectsV2UUID._some_custom def test_remove_uuid_endpoint_available(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) remove_uuid = pn.remove_uuid_metadata() assert remove_uuid is not None @@ -112,16 +112,16 @@ def test_remove_uuid_endpoint_available(self): assert isinstance(remove_uuid, Endpoint) def test_remove_uuid_is_endpoint(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) remove_uuid = pn.remove_uuid_metadata() assert isinstance(remove_uuid, RemoveUuid) assert isinstance(remove_uuid, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/uuid/remove_uuid.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_remove_uuid_happy_path(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) remove_uid_result = pn.remove_uuid_metadata() \ @@ -133,7 +133,7 @@ def test_remove_uuid_happy_path(self): assert isinstance(remove_uid_result.status, PNStatus) def test_get_all_uuid_endpoint_available(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) get_all_uuid = pn.get_all_uuid_metadata() assert get_all_uuid is not None @@ -141,16 +141,16 @@ def test_get_all_uuid_endpoint_available(self): assert isinstance(get_all_uuid, Endpoint) def test_get_all_uuid_is_endpoint(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) get_all_uuid = pn.get_all_uuid_metadata() assert isinstance(get_all_uuid, GetAllUuid) assert isinstance(get_all_uuid, Endpoint) - @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.yaml', - filter_query_parameters=['uuid', 'pnsdk']) + @pn_vcr.use_cassette('tests/integrational/fixtures/native_sync/objects_v2/uuid/get_all_uuid.json', + filter_query_parameters=['uuid', 'pnsdk'], serializer='pn_json') def test_get_all_uuid_happy_path(self): - config = pnconf_copy() + config = pnconf_env_copy() pn = PubNub(config) get_all_uuid_result = pn.get_all_uuid_metadata() \ From 84ce78f4c2a6a79221000d23ac4f15f32fadc4ff Mon Sep 17 00:00:00 2001 From: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:47:30 +0000 Subject: [PATCH 4/4] PubNub SDK v7.4.2 release. --- .pubnub.yml | 13 +++++++++---- CHANGELOG.md | 6 ++++++ pubnub/pubnub_core.py | 2 +- setup.py | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 830a3fa0..ac2b4664 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,5 +1,5 @@ name: python -version: 7.4.1 +version: 7.4.2 schema: 1 scm: github.com/pubnub/python sdks: @@ -18,7 +18,7 @@ sdks: distributions: - distribution-type: library distribution-repository: package - package-name: pubnub-7.4.1 + package-name: pubnub-7.4.2 location: https://pypi.org/project/pubnub/ supported-platforms: supported-operating-systems: @@ -97,8 +97,8 @@ sdks: - distribution-type: library distribution-repository: git release - package-name: pubnub-7.4.1 - location: https://github.com/pubnub/python/releases/download/v7.4.1/pubnub-7.4.1.tar.gz + package-name: pubnub-7.4.2 + location: https://github.com/pubnub/python/releases/download/v7.4.2/pubnub-7.4.2.tar.gz supported-platforms: supported-operating-systems: Linux: @@ -169,6 +169,11 @@ sdks: license-url: https://github.com/aio-libs/aiohttp/blob/master/LICENSE.txt is-required: Required changelog: + - date: 2024-03-07 + version: v7.4.2 + changes: + - type: bug + text: "Add missing status and type fields in app context. Now they are included, by default, in the response for getting channel/uuid metadata ." - date: 2024-02-26 version: v7.4.1 changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f5a5016..daa66d8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v7.4.2 +March 07 2024 + +#### Fixed +- Add missing status and type fields in app context. Now they are included, by default, in the response for getting channel/uuid metadata . + ## v7.4.1 February 26 2024 diff --git a/pubnub/pubnub_core.py b/pubnub/pubnub_core.py index d51edc0c..0e16be77 100644 --- a/pubnub/pubnub_core.py +++ b/pubnub/pubnub_core.py @@ -85,7 +85,7 @@ class PubNubCore: """A base class for PubNub Python API implementations""" - SDK_VERSION = "7.4.1" + SDK_VERSION = "7.4.2" SDK_NAME = "PubNub-Python" TIMESTAMP_DIVIDER = 1000 diff --git a/setup.py b/setup.py index ec2eee7b..0c7b3049 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='pubnub', - version='7.4.1', + version='7.4.2', description='PubNub Real-time push service in the cloud', author='PubNub', author_email='support@pubnub.com',