From 39fe5051425daf8e61d1b970ca6e64da136420a8 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Fri, 8 Nov 2024 09:28:57 +0100 Subject: [PATCH 1/3] some test fixing --- pubnub/pubnub_asyncio.py | 18 +- tests/integrational/asyncio/test_fire.py | 6 +- tests/integrational/asyncio/test_publish.py | 66 ++--- tests/integrational/asyncio/test_subscribe.py | 3 + .../asyncio/publish/do_not_store.json | 52 ++++ .../asyncio/publish/do_not_store.yaml | 15 -- .../fixtures/asyncio/publish/fire_get.json | 52 ++++ .../fixtures/asyncio/publish/fire_get.yaml | 19 -- .../fixtures/asyncio/publish/invalid_key.json | 52 ++++ .../fixtures/asyncio/publish/invalid_key.yaml | 15 -- .../fixtures/asyncio/publish/meta_object.json | 52 ++++ .../fixtures/asyncio/publish/meta_object.yaml | 15 -- .../asyncio/publish/mixed_via_get.json | 193 ++++++++++++++ .../asyncio/publish/mixed_via_get.yaml | 54 ---- .../publish/mixed_via_get_encrypted.json | 193 ++++++++++++++ .../publish/mixed_via_get_encrypted.yaml | 118 --------- .../asyncio/publish/mixed_via_post.json | 205 +++++++++++++++ .../asyncio/publish/mixed_via_post.yaml | 54 ---- .../publish/mixed_via_post_encrypted.json | 205 +++++++++++++++ .../publish/mixed_via_post_encrypted.yaml | 118 --------- .../asyncio/publish/not_permitted.json | 61 +++++ .../asyncio/publish/not_permitted.yaml | 20 -- .../asyncio/publish/object_via_get.json | 52 ++++ .../asyncio/publish/object_via_get.yaml | 15 -- .../publish/object_via_get_encrypted.json | 52 ++++ .../publish/object_via_get_encrypted.yaml | 31 --- .../asyncio/publish/object_via_post.json | 55 ++++ .../asyncio/publish/object_via_post.yaml | 15 -- .../publish/object_via_post_encrypted.json | 55 ++++ .../publish/object_via_post_encrypted.yaml | 31 --- .../asyncio/subscription/cg_join_leave.json | 240 ++++++++++++++++++ .../asyncio/subscription/sub_unsub.json | 100 ++++++++ .../test_publish_file_with_custom_type.json | 58 +++++ .../publish/publish_custom_message_type.json | 58 +++++ .../signal/signal_custom_message_type.json | 58 +++++ 35 files changed, 1839 insertions(+), 567 deletions(-) create mode 100644 tests/integrational/fixtures/asyncio/publish/do_not_store.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/do_not_store.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/fire_get.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/fire_get.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/invalid_key.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/invalid_key.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/meta_object.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/meta_object.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/mixed_via_get.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/mixed_via_get.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/mixed_via_post.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/mixed_via_post.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/not_permitted.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/not_permitted.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/object_via_get.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/object_via_get.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/object_via_post.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/object_via_post.yaml create mode 100644 tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json delete mode 100644 tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.yaml create mode 100644 tests/integrational/fixtures/asyncio/subscription/cg_join_leave.json create mode 100644 tests/integrational/fixtures/asyncio/subscription/sub_unsub.json create mode 100644 tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json create mode 100644 tests/integrational/fixtures/native_sync/publish/publish_custom_message_type.json create mode 100644 tests/integrational/fixtures/native_sync/signal/signal_custom_message_type.json diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index e19d6ca0..0d44e818 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -62,11 +62,12 @@ async def close_pending_tasks(self, tasks): await asyncio.sleep(0.1) async def create_session(self): - self._session = aiohttp.ClientSession( - loop=self.event_loop, - timeout=aiohttp.ClientTimeout(connect=self.config.connect_timeout), - connector=self._connector - ) + if not self._session: + self._session = aiohttp.ClientSession( + loop=self.event_loop, + timeout=aiohttp.ClientTimeout(connect=self.config.connect_timeout), + connector=self._connector + ) async def close_session(self): if self._session is not None: @@ -76,12 +77,7 @@ async def set_connector(self, cn): await self._session.close() self._connector = cn - - self._session = aiohttp.ClientSession( - loop=self.event_loop, - timeout=aiohttp.ClientTimeout(connect=self.config.connect_timeout), - connector=self._connector - ) + await self.create_session() async def stop(self): if self._subscription_manager: diff --git a/tests/integrational/asyncio/test_fire.py b/tests/integrational/asyncio/test_fire.py index 8321b5b2..9a9a513f 100644 --- a/tests/integrational/asyncio/test_fire.py +++ b/tests/integrational/asyncio/test_fire.py @@ -1,6 +1,6 @@ import pytest -from tests.helper import pnconf_copy +from tests.helper import pnconf_env_copy from tests.integrational.vcr_helper import pn_vcr from pubnub.pubnub_asyncio import PubNubAsyncio, AsyncioEnvelope from pubnub.models.consumer.pubsub import PNFireResult @@ -8,12 +8,12 @@ @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/fire_get.yaml', + 'tests/integrational/fixtures/asyncio/publish/fire_get.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio async def test_single_channel(event_loop): - config = pnconf_copy() + config = pnconf_env_copy() config.enable_subscribe = False pn = PubNubAsyncio(config, custom_event_loop=event_loop) chan = 'unique_sync' diff --git a/tests/integrational/asyncio/test_publish.py b/tests/integrational/asyncio/test_publish.py index 1e48dfcb..c17e4eed 100644 --- a/tests/integrational/asyncio/test_publish.py +++ b/tests/integrational/asyncio/test_publish.py @@ -9,7 +9,7 @@ from pubnub.models.consumer.common import PNStatus from pubnub.models.consumer.pubsub import PNPublishResult from pubnub.pubnub_asyncio import PubNubAsyncio, AsyncioEnvelope, PubNubAsyncioException -from tests.helper import pnconf_copy, pnconf_enc_copy, pnconf_pam_copy +from tests.helper import pnconf_enc_env_copy, pnconf_pam_env_copy, pnconf_env_copy from tests.integrational.vcr_helper import pn_vcr pn.set_stream_logger('pubnub', logging.DEBUG) @@ -47,12 +47,12 @@ async def assert_success_publish_post(pubnub, msg): @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/mixed_via_get.yaml', - filter_query_parameters=['uuid', 'seqn', 'pnsdk'] + 'tests/integrational/fixtures/asyncio/publish/mixed_via_get.json', serializer='pn_json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub'] ) @pytest.mark.asyncio async def test_publish_mixed_via_get(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) await asyncio.gather( asyncio.ensure_future(assert_success_publish_get(pubnub, "hi")), asyncio.ensure_future(assert_success_publish_get(pubnub, 5)), @@ -64,24 +64,24 @@ async def test_publish_mixed_via_get(event_loop): @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/object_via_get.yaml', + 'tests/integrational/fixtures/asyncio/publish/object_via_get.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk'], match_on=['method', 'scheme', 'host', 'port', 'object_in_path', 'query'] ) @pytest.mark.asyncio async def test_publish_object_via_get(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) await asyncio.ensure_future(assert_success_publish_get(pubnub, {"name": "Alex", "online": True})) await pubnub.stop() @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/mixed_via_post.yaml', - filter_query_parameters=['uuid', 'seqn', 'pnsdk']) + 'tests/integrational/fixtures/asyncio/publish/mixed_via_post.json', serializer='pn_json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub']) @pytest.mark.asyncio async def test_publish_mixed_via_post(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) await asyncio.gather( asyncio.ensure_future(assert_success_publish_post(pubnub, "hi")), asyncio.ensure_future(assert_success_publish_post(pubnub, 5)), @@ -92,24 +92,24 @@ async def test_publish_mixed_via_post(event_loop): @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/object_via_post.yaml', + 'tests/integrational/fixtures/asyncio/publish/object_via_post.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk'], match_on=['method', 'scheme', 'host', 'port', 'path', 'query', 'object_in_body']) @pytest.mark.asyncio async def test_publish_object_via_post(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) await asyncio.ensure_future(assert_success_publish_post(pubnub, {"name": "Alex", "online": True})) await pubnub.stop() @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.yaml', - filter_query_parameters=['uuid', 'seqn', 'pnsdk']) + 'tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json', serializer='pn_json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub']) @pytest.mark.asyncio async def test_publish_mixed_via_get_encrypted(event_loop): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): - pubnub = PubNubAsyncio(pnconf_enc_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) await asyncio.gather( asyncio.ensure_future(assert_success_publish_get(pubnub, "hi")), asyncio.ensure_future(assert_success_publish_get(pubnub, 5)), @@ -120,28 +120,28 @@ async def test_publish_mixed_via_get_encrypted(event_loop): @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.yaml', + 'tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk'], match_on=['host', 'method', 'query'] ) @pytest.mark.asyncio async def test_publish_object_via_get_encrypted(event_loop): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): - pubnub = PubNubAsyncio(pnconf_enc_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) await asyncio.ensure_future(assert_success_publish_get(pubnub, {"name": "Alex", "online": True})) await pubnub.stop() @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.yaml', - filter_query_parameters=['uuid', 'seqn', 'pnsdk'], + 'tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json', serializer='pn_json', + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub'], match_on=['method', 'path', 'query', 'body'] ) @pytest.mark.asyncio async def test_publish_mixed_via_post_encrypted(event_loop): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): - pubnub = PubNubAsyncio(pnconf_enc_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) await asyncio.gather( asyncio.ensure_future(assert_success_publish_post(pubnub, "hi")), asyncio.ensure_future(assert_success_publish_post(pubnub, 5)), @@ -153,14 +153,14 @@ async def test_publish_mixed_via_post_encrypted(event_loop): @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.yaml', + 'tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk'], match_on=['method', 'path', 'query'] ) @pytest.mark.asyncio async def test_publish_object_via_post_encrypted(event_loop): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): - pubnub = PubNubAsyncio(pnconf_enc_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) await asyncio.ensure_future(assert_success_publish_post(pubnub, {"name": "Alex", "online": True})) await pubnub.stop() @@ -168,7 +168,7 @@ async def test_publish_object_via_post_encrypted(event_loop): @pytest.mark.asyncio async def test_error_missing_message(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) await assert_client_side_error(pubnub.publish().channel(ch).message(None), "Message missing") await pubnub.stop() @@ -176,7 +176,7 @@ async def test_error_missing_message(event_loop): @pytest.mark.asyncio async def test_error_missing_channel(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) await assert_client_side_error(pubnub.publish().channel("").message("hey"), "Channel missing") await pubnub.stop() @@ -184,7 +184,7 @@ async def test_error_missing_channel(event_loop): @pytest.mark.asyncio async def test_error_non_serializable(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) def method(): pass @@ -194,23 +194,23 @@ def method(): @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/meta_object.yaml', + 'tests/integrational/fixtures/asyncio/publish/meta_object.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk'], match_on=['host', 'method', 'path', 'meta_object_in_query']) @pytest.mark.asyncio async def test_publish_with_meta(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) await assert_success_await(pubnub.publish().channel(ch).message("hey").meta({'a': 2, 'b': 'qwer'})) await pubnub.stop() @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/do_not_store.yaml', + 'tests/integrational/fixtures/asyncio/publish/do_not_store.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk']) @pytest.mark.asyncio async def test_publish_do_not_store(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) await assert_success_await(pubnub.publish().channel(ch).message("hey").should_store(False)) await pubnub.stop() @@ -225,11 +225,11 @@ async def assert_server_side_error_yield(pub, expected_err_msg): @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/invalid_key.yaml', + 'tests/integrational/fixtures/asyncio/publish/invalid_key.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk']) @pytest.mark.asyncio async def test_error_invalid_key(event_loop): - pnconf = pnconf_pam_copy() + pnconf = pnconf_pam_env_copy() pubnub = PubNubAsyncio(pnconf, custom_event_loop=event_loop) @@ -238,11 +238,11 @@ async def test_error_invalid_key(event_loop): @pn_vcr.use_cassette( - 'tests/integrational/fixtures/asyncio/publish/not_permitted.yaml', + 'tests/integrational/fixtures/asyncio/publish/not_permitted.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'signature', 'timestamp', 'pnsdk']) @pytest.mark.asyncio async def test_not_permitted(event_loop): - pnconf = pnconf_pam_copy() + pnconf = pnconf_pam_env_copy() pnconf.secret_key = None pubnub = PubNubAsyncio(pnconf, custom_event_loop=event_loop) @@ -252,7 +252,7 @@ async def test_not_permitted(event_loop): @pytest.mark.asyncio async def test_publish_super_admin_call(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_pam_env_copy(), custom_event_loop=event_loop) await pubnub.publish().channel(ch).message("hey").future() await pubnub.publish().channel("f#!|oo.bar").message("hey^&#$").should_store(True).meta({ diff --git a/tests/integrational/asyncio/test_subscribe.py b/tests/integrational/asyncio/test_subscribe.py index e98c94b5..9e29bfe3 100644 --- a/tests/integrational/asyncio/test_subscribe.py +++ b/tests/integrational/asyncio/test_subscribe.py @@ -336,6 +336,7 @@ async def test_cg_join_leave(): assert prs_envelope.uuid == pubnub_listener.uuid assert prs_envelope.channel == ch assert prs_envelope.subscription == gr + await asyncio.sleep(2) pubnub.add_listener(callback_messages) pubnub.subscribe().channel_groups(gr).execute() @@ -349,6 +350,7 @@ async def test_cg_join_leave(): assert prs_envelope.uuid == pubnub.uuid assert prs_envelope.channel == ch assert prs_envelope.subscription == gr + await asyncio.sleep(2) pubnub.unsubscribe().channel_groups(gr).execute() @@ -363,6 +365,7 @@ async def test_cg_join_leave(): assert prs_envelope.subscription == gr pubnub_listener.unsubscribe().channel_groups(gr).execute() + await asyncio.sleep(2) # with EE you don't have to wait for disconnect if isinstance(pubnub._subscription_manager, AsyncioSubscriptionManager): diff --git a/tests/integrational/fixtures/asyncio/publish/do_not_store.json b/tests/integrational/fixtures/asyncio/publish/do_not_store.json new file mode 100644 index 00000000..d25bdbea --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/do_not_store.json @@ -0,0 +1,52 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?store=0", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:19 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815792197704\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/do_not_store.yaml b/tests/integrational/fixtures/asyncio/publish/do_not_store.yaml deleted file mode 100644 index 13804148..00000000 --- a/tests/integrational/fixtures/asyncio/publish/do_not_store.yaml +++ /dev/null @@ -1,15 +0,0 @@ -interactions: -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hey%22?store=0 - response: - body: {string: '[1,"Sent","14820978549499111"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hey%22?seqn=1&store=0&uuid=dc05f6a6-e648-4cf1-bbfa-b212ef5945e6&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/fire_get.json b/tests/integrational/fixtures/asyncio/publish/fire_get.json new file mode 100644 index 00000000..a600a169 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/fire_get.json @@ -0,0 +1,52 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/unique_sync/0/%22bla%22?norep=1&store=0", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 09:02:46 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308837665022824\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/fire_get.yaml b/tests/integrational/fixtures/asyncio/publish/fire_get.yaml deleted file mode 100644 index 881a4be3..00000000 --- a/tests/integrational/fixtures/asyncio/publish/fire_get.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: null - headers: - User-Agent: [PubNub-Python-Asyncio/4.1.0] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/unique_sync/0/%22bla%22?norep=1&store=0 - response: - body: {string: '[1,"Sent","15549258055663067"]'} - headers: {Access-Control-Allow-Methods: GET, Access-Control-Allow-Origin: '*', - Cache-Control: no-cache, Connection: keep-alive, Content-Length: '30', Content-Type: text/javascript; - charset="UTF-8", Date: 'Wed, 10 Apr 2019 19:50:05 GMT'} - status: {code: 200, message: OK} - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult [http, ps.pndsn.com, /publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/unique_sync/0/%22bla%22, - store=0&norep=1&pnsdk=PubNub-Python-Asyncio%2F4.1.0&uuid=f88b25d0-45ca-41b5-870f-9118a002e4e3, - ''] -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/invalid_key.json b/tests/integrational/fixtures/asyncio/publish/invalid_key.json new file mode 100644 index 00000000..50207a81 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/invalid_key.json @@ -0,0 +1,52 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PAM_PUBLISH}/{PN_KEY_PAM_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?signature=v2.2GP5vSoYombvpD8JhGyyodcwFVe7K5SiBoYVHnK5mOg×tamp=1730881579", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:19 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815793493634\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/invalid_key.yaml b/tests/integrational/fixtures/asyncio/publish/invalid_key.yaml deleted file mode 100644 index 77f5c59e..00000000 --- a/tests/integrational/fixtures/asyncio/publish/invalid_key.yaml +++ /dev/null @@ -1,15 +0,0 @@ -interactions: -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/fake/demo/0/asyncio-int-publish/0/%22hey%22 - response: - body: {string: '[0,"Invalid Key","14820978550352022"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '37', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:55 GMT'} - status: {code: 400, message: INVALID} - url: https://ps.pndsn.com/publish/fake/demo/0/asyncio-int-publish/0/%22hey%22?seqn=1&uuid=67af3c55-453e-45f7-bdbd-294d5499cd88&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/meta_object.json b/tests/integrational/fixtures/asyncio/publish/meta_object.json new file mode 100644 index 00000000..c130674d --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/meta_object.json @@ -0,0 +1,52 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?meta=%7B%22a%22%3A+2%2C+%22b%22%3A+%22qwer%22%7D", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:19 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815790735971\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/meta_object.yaml b/tests/integrational/fixtures/asyncio/publish/meta_object.yaml deleted file mode 100644 index 5289fe5a..00000000 --- a/tests/integrational/fixtures/asyncio/publish/meta_object.yaml +++ /dev/null @@ -1,15 +0,0 @@ -interactions: -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hey%22?meta=%7B%22a%22%3A+2%2C+%22b%22%3A+%22qwer%22%7D - response: - body: {string: '[1,"Sent","14820978548732558"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hey%22?seqn=1&meta=%7B%22a%22%3A%202%2C%20%22b%22%3A%20%22qwer%22%7D&uuid=5cf73370-124e-4bc0-8d93-ce450d3dbfe3&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json new file mode 100644 index 00000000..91172242 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json @@ -0,0 +1,193 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/5", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815775025317\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%5B%22hi%22%2C%20%22hi2%22%2C%20%22hi3%22%5D", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815775031244\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hi%22", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815775030621\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/true", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815775046564\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_get.yaml b/tests/integrational/fixtures/asyncio/publish/mixed_via_get.yaml deleted file mode 100644 index fb6775ed..00000000 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_get.yaml +++ /dev/null @@ -1,54 +0,0 @@ -interactions: -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%5B%22hi%22%2C%20%22hi2%22%2C%20%22hi3%22%5D - response: - body: {string: '[1,"Sent","14820978538596935"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:53 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%5B%22hi%22%2C%20%22hi2%22%2C%20%22hi3%22%5D?seqn=4&uuid=ec1fa148-ba88-4d0a-93fb-748bf50599a9&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hi%22 - response: - body: {string: '[1,"Sent","14820978538628289"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:53 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hi%22?seqn=1&uuid=ec1fa148-ba88-4d0a-93fb-748bf50599a9&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/true - response: - body: {string: '[1,"Sent","14820978538632877"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:53 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/true?seqn=3&uuid=ec1fa148-ba88-4d0a-93fb-748bf50599a9&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/5 - response: - body: {string: '[1,"Sent","14820978541276088"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/5?seqn=2&uuid=ec1fa148-ba88-4d0a-93fb-748bf50599a9&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json new file mode 100644 index 00000000..6c0c0421 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json @@ -0,0 +1,193 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA%3D%22", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815780560899\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NclhU9jqi%2B5cNMXFiry5TPU%3D%22", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815780620270\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NS%2FB7ZYYL%2F8ZE%2FNEGBapOF0%3D%22", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815781237669\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX%2BmTa3M0vVg2xcyYg7CW45mG%22", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815782561468\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.yaml b/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.yaml deleted file mode 100644 index 8edd8544..00000000 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.yaml +++ /dev/null @@ -1,118 +0,0 @@ -interactions: -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NclhU9jqi%2B5cNMXFiry5TPU%3D%22 - response: - body: - string: '[1,"Sent","16148857841894127"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NclhU9jqi%2B5cNMXFiry5TPU%3D%22?seqn=1&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=86307efc-08ea-4333-89d4-e3fea1e0597e -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX%2BmTa3M0vVg2xcyYg7CW45mG%22 - response: - body: - string: '[1,"Sent","16148857842006790"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX%2BmTa3M0vVg2xcyYg7CW45mG%22?seqn=4&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=86307efc-08ea-4333-89d4-e3fea1e0597e -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA%3D%22 - response: - body: - string: '[1,"Sent","16148857842144106"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA%3D%22?seqn=3&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=86307efc-08ea-4333-89d4-e3fea1e0597e -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NS%2FB7ZYYL%2F8ZE%2FNEGBapOF0%3D%22 - response: - body: - string: '[1,"Sent","16148857842150439"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NS%2FB7ZYYL%2F8ZE%2FNEGBapOF0%3D%22?seqn=2&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=86307efc-08ea-4333-89d4-e3fea1e0597e -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json new file mode 100644 index 00000000..7628f20d --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json @@ -0,0 +1,205 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "5", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815777895010\"]" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "[\"hi\", \"hi2\", \"hi3\"]", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815777896816\"]" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "true", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815777903670\"]" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"hi\"", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815777906104\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_post.yaml b/tests/integrational/fixtures/asyncio/publish/mixed_via_post.yaml deleted file mode 100644 index d7448518..00000000 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_post.yaml +++ /dev/null @@ -1,54 +0,0 @@ -interactions: -- request: - body: 'true' - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: {string: '[1,"Sent","14820978543080292"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=3&uuid=36c260f4-12f7-4060-85c1-d34096146bda&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -- request: - body: '"hi"' - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: {string: '[1,"Sent","14820978543212753"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=1&uuid=36c260f4-12f7-4060-85c1-d34096146bda&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -- request: - body: '["hi", "hi2", "hi3"]' - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: {string: '[1,"Sent","14820978543265053"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=4&uuid=36c260f4-12f7-4060-85c1-d34096146bda&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -- request: - body: '5' - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: {string: '[1,"Sent","14820978543321181"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=2&uuid=36c260f4-12f7-4060-85c1-d34096146bda&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json new file mode 100644 index 00000000..c33d9194 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json @@ -0,0 +1,205 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX+mTa3M0vVg2xcyYg7CW45mG\"", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815785493215\"]" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NclhU9jqi+5cNMXFiry5TPU=\"", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815785535925\"]" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA=\"", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815785539657\"]" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NS/B7ZYYL/8ZE/NEGBapOF0=\"", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815787486416\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.yaml b/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.yaml deleted file mode 100644 index 27ede39f..00000000 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.yaml +++ /dev/null @@ -1,118 +0,0 @@ -interactions: -- request: - body: '"a25pZ2h0c29mbmkxMjM0NclhU9jqi+5cNMXFiry5TPU="' - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: - string: '[1,"Sent","16148857846165706"]' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - POST - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=1&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=ca19afca-c112-4ca1-a7d8-6e8f663ea7d3 -- request: - body: '"a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX+mTa3M0vVg2xcyYg7CW45mG"' - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: - string: '[1,"Sent","16148857846388706"]' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - POST - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=4&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=ca19afca-c112-4ca1-a7d8-6e8f663ea7d3 -- request: - body: '"a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA="' - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: - string: '[1,"Sent","16148857846412945"]' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - POST - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=3&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=ca19afca-c112-4ca1-a7d8-6e8f663ea7d3 -- request: - body: '"a25pZ2h0c29mbmkxMjM0NS/B7ZYYL/8ZE/NEGBapOF0="' - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: - string: '[1,"Sent","16148857846404888"]' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - POST - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=2&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=ca19afca-c112-4ca1-a7d8-6e8f663ea7d3 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/not_permitted.json b/tests/integrational/fixtures/asyncio/publish/not_permitted.json new file mode 100644 index 00000000..45a937cd --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/not_permitted.json @@ -0,0 +1,61 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PAM_PUBLISH}/{PN_KEY_PAM_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 403, + "message": "Forbidden" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:19 GMT" + ], + "Content-Type": [ + "text/javascript; charset=UTF-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "X-Pn-Cause": [ + "9999" + ], + "Cache-Control": [ + "no-cache, no-store, must-revalidate" + ], + "Access-Control-Allow-Headers": [ + "Origin, X-Requested-With, Content-Type, Accept" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ], + "Content-Encoding": [ + "gzip" + ] + }, + "body": { + "string": "{\"message\": \"Forbidden\", \"payload\": {\"channels\": [\"asyncio-int-publish\"]}, \"error\": true, \"service\": \"Access Manager\", \"status\": 403}\n" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/not_permitted.yaml b/tests/integrational/fixtures/asyncio/publish/not_permitted.yaml deleted file mode 100644 index 3e3476ca..00000000 --- a/tests/integrational/fixtures/asyncio/publish/not_permitted.yaml +++ /dev/null @@ -1,20 +0,0 @@ -interactions: -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-98863562-19a6-4760-bf0b-d537d1f5c582/sub-c-7ba2ac4c-4836-11e6-85a4-0619f8945a4f/0/asyncio-int-publish/0/%22hey%22 - response: - body: {string: '{"message":"Forbidden","payload":{"channels":["asyncio-int-publish"]},"error":true,"service":"Access - Manager","status":403} - -'} - headers: {ACCESS-CONTROL-ALLOW-HEADERS: 'Origin, X-Requested-With, Content-Type, - Accept', ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: 'no-cache, no-store, must-revalidate', CONNECTION: keep-alive, - CONTENT-ENCODING: gzip, CONTENT-TYPE: text/javascript; charset=UTF-8, DATE: 'Sun, - 18 Dec 2016 21:50:55 GMT', SERVER: nginx, TRANSFER-ENCODING: chunked, X-BLOCKS-ENABLED: '0'} - status: {code: 403, message: Forbidden} - url: https://ps.pndsn.com/publish/pub-c-98863562-19a6-4760-bf0b-d537d1f5c582/sub-c-7ba2ac4c-4836-11e6-85a4-0619f8945a4f/0/asyncio-int-publish/0/%22hey%22?seqn=1&uuid=48600fc7-b3ea-487e-abdc-622c3feec615&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_get.json b/tests/integrational/fixtures/asyncio/publish/object_via_get.json new file mode 100644 index 00000000..afea815b --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/object_via_get.json @@ -0,0 +1,52 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%7B%22name%22%3A%20%22Alex%22%2C%20%22online%22%3A%20true%7D", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815776476487\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_get.yaml b/tests/integrational/fixtures/asyncio/publish/object_via_get.yaml deleted file mode 100644 index 6b7688c0..00000000 --- a/tests/integrational/fixtures/asyncio/publish/object_via_get.yaml +++ /dev/null @@ -1,15 +0,0 @@ -interactions: -- request: - body: null - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%7B%22online%22%3A%20true%2C%20%22name%22%3A%20%22Alex%22%7D - response: - body: {string: '[1,"Sent","14820978542248113"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%7B%22online%22%3A%20true%2C%20%22name%22%3A%20%22Alex%22%7D?seqn=1&uuid=be0961fa-1d5e-43ec-83f4-39c8cd91f046&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json b/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json new file mode 100644 index 00000000..b7b3de8d --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json @@ -0,0 +1,52 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR%2BzhR3WaTKTArF54xtAoq4J7zUtg%3D%3D%22", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815783947099\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.yaml b/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.yaml deleted file mode 100644 index 61db6206..00000000 --- a/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: GET - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR%2BzhR3WaTKTArF54xtAoq4J7zUtg%3D%3D%22 - response: - body: - string: '[1,"Sent","16148857844085964"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR%2BzhR3WaTKTArF54xtAoq4J7zUtg%3D%3D%22?seqn=1&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=82d1d473-660d-4106-8d2d-647bec950187 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_post.json b/tests/integrational/fixtures/asyncio/publish/object_via_post.json new file mode 100644 index 00000000..f5400c02 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/object_via_post.json @@ -0,0 +1,55 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "{\"name\": \"Alex\", \"online\": true}", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:17 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815779241046\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_post.yaml b/tests/integrational/fixtures/asyncio/publish/object_via_post.yaml deleted file mode 100644 index 6ad7eeaf..00000000 --- a/tests/integrational/fixtures/asyncio/publish/object_via_post.yaml +++ /dev/null @@ -1,15 +0,0 @@ -interactions: -- request: - body: '{"online": true, "name": "Alex"}' - headers: - USER-AGENT: [PubNub-Python-Asyncio/4.0.4] - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: {string: '[1,"Sent","14820978544115848"]'} - headers: {ACCESS-CONTROL-ALLOW-METHODS: GET, ACCESS-CONTROL-ALLOW-ORIGIN: '*', - CACHE-CONTROL: no-cache, CONNECTION: keep-alive, CONTENT-LENGTH: '30', CONTENT-TYPE: text/javascript; - charset="UTF-8", DATE: 'Sun, 18 Dec 2016 21:50:54 GMT'} - status: {code: 200, message: OK} - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=1&uuid=73b4e16c-38ee-4d54-99f3-2dd4b7f85169&pnsdk=PubNub-Python-Asyncio%2F4.0.4 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json b/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json new file mode 100644 index 00000000..b55852b9 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json @@ -0,0 +1,55 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR+zhR3WaTKTArF54xtAoq4J7zUtg==\"", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 08:26:18 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "POST" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17308815788886238\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.yaml b/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.yaml deleted file mode 100644 index 7b3cb85e..00000000 --- a/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: '"a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR+zhR3WaTKTArF54xtAoq4J7zUtg=="' - headers: - User-Agent: - - PubNub-Python-Asyncio/5.0.1 - method: POST - uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0 - response: - body: - string: '[1,"Sent","16148857848332772"]' - headers: - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - POST - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 19:23:04 GMT - status: - code: 200 - message: OK - url: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0?seqn=1&pnsdk=PubNub-Python-Asyncio%2F5.0.1&uuid=bc256f0e-0b29-46e4-97a1-d8f18a69c7b8 -version: 1 diff --git a/tests/integrational/fixtures/asyncio/subscription/cg_join_leave.json b/tests/integrational/fixtures/asyncio/subscription/cg_join_leave.json new file mode 100644 index 00000000..d9381dfa --- /dev/null +++ b/tests/integrational/fixtures/asyncio/subscription/cg_join_leave.json @@ -0,0 +1,240 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/channel-registration/sub-key/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channel-group/test-subscribe-asyncio-join-leave-cg-group?add=test-subscribe-asyncio-join-leave-cg-channel&uuid=test-subscribe-asyncio-messenger", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 29 Oct 2024 11:50:12 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "72" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Methods": [ + "GET, POST, DELETE, OPTIONS" + ], + "Age": [ + "0" + ], + "Server": [ + "Pubnub Storage" + ], + "Cache-Control": [ + "no-cache" + ], + "Accept-Ranges": [ + "bytes" + ] + }, + "body": { + "string": "{\"error\":false,\"message\":\"OK\",\"service\":\"channel-registry\",\"status\":200}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/subscribe/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/,/0?channel-group=test-subscribe-asyncio-join-leave-cg-group%2Ctest-subscribe-asyncio-join-leave-cg-group-pnpres&ee=1&heartbeat=30&tt=0&uuid=test-subscribe-asyncio-listener", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 29 Oct 2024 11:50:13 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "45" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Methods": [ + "GET" + ] + }, + "body": { + "string": "{\"t\":{\"t\":\"17302025729072975\",\"r\":41},\"m\":[]}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/subscribe/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/,/0?channel-group=test-subscribe-asyncio-join-leave-cg-group%2Ctest-subscribe-asyncio-join-leave-cg-group-pnpres&ee=1&heartbeat=30&tr=41&tt=17302025729072975&uuid=test-subscribe-asyncio-listener", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 29 Oct 2024 11:50:14 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Content-Encoding": [ + "gzip" + ] + }, + "body": { + "string": "{\"t\":{\"t\":\"17302026145246029\",\"r\":41},\"m\":[{\"a\":\"2\",\"f\":0,\"p\":{\"t\":\"17302026145246029\",\"r\":42},\"k\":\"sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe\",\"c\":\"test-subscribe-asyncio-join-leave-cg-channel-pnpres\",\"u\":{\"pn_action\":\"join\",\"pn_uuid\":\"test-subscribe-asyncio-listener\",\"pn_timestamp\":1730202614,\"pn_precise_timestamp\":1730202614520,\"pn_occupancy\":1,\"pn_ispresence\":1,\"pn_channel\":\"test-subscribe-asyncio-join-leave-cg-channel\"},\"d\":{\"action\":\"join\",\"uuid\":\"test-subscribe-asyncio-listener\",\"timestamp\":1730202614,\"precise_timestamp\":1730202614520,\"occupancy\":1},\"b\":\"test-subscribe-asyncio-join-leave-cg-group-pnpres\"}]}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/subscribe/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/,/0?channel-group=test-subscribe-asyncio-join-leave-cg-group&ee=1&heartbeat=30&l_cg=0.2459278106689453&tt=0&uuid=test-subscribe-asyncio-messenger", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 29 Oct 2024 11:50:14 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "45" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Methods": [ + "GET" + ] + }, + "body": { + "string": "{\"t\":{\"t\":\"17302026148660004\",\"r\":43},\"m\":[]}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/subscribe/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/,/0?channel-group=test-subscribe-asyncio-join-leave-cg-group%2Ctest-subscribe-asyncio-join-leave-cg-group-pnpres&ee=1&heartbeat=30&tr=41&tt=17302026145246029&uuid=test-subscribe-asyncio-listener", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 29 Oct 2024 11:50:15 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Content-Encoding": [ + "gzip" + ] + }, + "body": { + "string": "{\"t\":{\"t\":\"17302026156815862\",\"r\":41},\"m\":[{\"a\":\"2\",\"f\":0,\"p\":{\"t\":\"17302026156815862\",\"r\":43},\"k\":\"sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe\",\"c\":\"test-subscribe-asyncio-join-leave-cg-channel-pnpres\",\"u\":{\"pn_action\":\"join\",\"pn_uuid\":\"test-subscribe-asyncio-messenger\",\"pn_timestamp\":1730202615,\"pn_precise_timestamp\":1730202615678,\"pn_occupancy\":2,\"pn_ispresence\":1,\"pn_channel\":\"test-subscribe-asyncio-join-leave-cg-channel\"},\"d\":{\"action\":\"join\",\"uuid\":\"test-subscribe-asyncio-messenger\",\"timestamp\":1730202615,\"precise_timestamp\":1730202615678,\"occupancy\":2},\"b\":\"test-subscribe-asyncio-join-leave-cg-group-pnpres\"}]}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/subscription/sub_unsub.json b/tests/integrational/fixtures/asyncio/subscription/sub_unsub.json new file mode 100644 index 00000000..4b4da73a --- /dev/null +++ b/tests/integrational/fixtures/asyncio/subscription/sub_unsub.json @@ -0,0 +1,100 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/subscribe/{PN_KEY_SUBSCRIBE}/test-subscribe-asyncio-ch/0?tt=0&uuid=uuid-mock", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 17:09:20 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "45" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"t\":{\"t\":\"17309129601106056\",\"r\":42},\"m\":[]}" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v2/subscribe/{PN_KEY_SUBSCRIBE}/test-subscribe-asyncio-ch/0?tt=17309129601106056&tr=42&ee=1&uuid=uuid-mock", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.0.0" + ] + } + }, + "response": { + "delay_before": 10, + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 06 Nov 2024 17:09:20 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "45" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"t\":{\"t\":\"17309129601106056\",\"r\":42},\"m\":[]}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json b/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json new file mode 100644 index 00000000..d884be54 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D?custom_message_type=test_message&meta=%7B%7D&store=0&ttl=0&uuid=uuid-mock", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/9.0.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Date": [ + "Mon, 21 Oct 2024 08:19:49 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "30" + ], + "Access-Control-Allow-Origin": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17294987898141374\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/publish/publish_custom_message_type.json b/tests/integrational/fixtures/native_sync/publish/publish_custom_message_type.json new file mode 100644 index 00000000..3e1a69de --- /dev/null +++ b/tests/integrational/fixtures/native_sync/publish/publish_custom_message_type.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/ch1/0/%22hi%22?custom_message_type=test_message&seqn=1", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/9.0.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Cache-Control": [ + "no-cache" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Date": [ + "Sun, 20 Oct 2024 19:55:24 GMT" + ], + "Access-Control-Allow-Methods": [ + "GET" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17294541245735301\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/signal/signal_custom_message_type.json b/tests/integrational/fixtures/native_sync/signal/signal_custom_message_type.json new file mode 100644 index 00000000..090c2f0a --- /dev/null +++ b/tests/integrational/fixtures/native_sync/signal/signal_custom_message_type.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/signal/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/ch1/0/%22hi%22?custom_message_type=test_message", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python/9.0.0" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Access-Control-Allow-Methods": [ + "GET" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Date": [ + "Sun, 20 Oct 2024 20:09:28 GMT" + ], + "Cache-Control": [ + "no-cache" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17294549685222612\"]" + } + } + } + ] +} From 81edd50ee2836999b844042bdbff8bfed9941697 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Fri, 8 Nov 2024 09:33:40 +0100 Subject: [PATCH 2/3] organization --- .github/workflows/commands-handler.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/run-tests.yml | 6 +++--- .github/workflows/run-validations.yml | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml index 48f71d24..51f8668f 100644 --- a/.github/workflows/commands-handler.yml +++ b/.github/workflows/commands-handler.yml @@ -12,7 +12,7 @@ jobs: name: Process command if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true runs-on: - group: Default + group: organization/Default steps: - name: Check referred user id: user-check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2fea0a01..4e95cd57 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: name: Check release required if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true runs-on: - group: Default + group: organization/Default outputs: release: ${{ steps.check.outputs.ready }} steps: @@ -31,7 +31,7 @@ jobs: needs: check-release if: needs.check-release.outputs.release == 'true' runs-on: - group: Default + group: organization/Default steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 60b87947..5aa63bba 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -21,7 +21,7 @@ jobs: tests: name: Integration and Unit tests runs-on: - group: Default + group: organization/Default strategy: max-parallel: 1 fail-fast: true @@ -54,7 +54,7 @@ jobs: acceptance-tests: name: Acceptance tests runs-on: - group: Default + group: organization/Default timeout-minutes: 5 steps: - name: Checkout project @@ -103,7 +103,7 @@ jobs: name: Tests needs: [tests, acceptance-tests] runs-on: - group: Default + group: organization/Default steps: - name: Tests summary run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index 265f8286..a6dcf056 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -6,7 +6,7 @@ jobs: lint: name: Lint project runs-on: - group: Default + group: organization/Default steps: - name: Checkout project uses: actions/checkout@v4 @@ -24,7 +24,7 @@ jobs: pubnub-yml: name: "Validate .pubnub.yml" runs-on: - group: Default + group: organization/Default steps: - name: Checkout project uses: actions/checkout@v4 @@ -46,7 +46,7 @@ jobs: name: Validations needs: [pubnub-yml, lint] runs-on: - group: Default + group: organization/Default steps: - name: Validations summary run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed" From 986afb266fb78d887c80e022a5ddbf3e7319d63b Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Fri, 8 Nov 2024 12:36:13 +0100 Subject: [PATCH 3/3] remove unused file --- .../asyncio/subscription/cg_join_leave.json | 240 ------------------ 1 file changed, 240 deletions(-) delete mode 100644 tests/integrational/fixtures/asyncio/subscription/cg_join_leave.json diff --git a/tests/integrational/fixtures/asyncio/subscription/cg_join_leave.json b/tests/integrational/fixtures/asyncio/subscription/cg_join_leave.json deleted file mode 100644 index d9381dfa..00000000 --- a/tests/integrational/fixtures/asyncio/subscription/cg_join_leave.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "version": 1, - "interactions": [ - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/channel-registration/sub-key/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/channel-group/test-subscribe-asyncio-join-leave-cg-group?add=test-subscribe-asyncio-join-leave-cg-channel&uuid=test-subscribe-asyncio-messenger", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.0.0" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Date": [ - "Tue, 29 Oct 2024 11:50:12 GMT" - ], - "Content-Type": [ - "application/json" - ], - "Content-Length": [ - "72" - ], - "Connection": [ - "keep-alive" - ], - "Access-Control-Allow-Origin": [ - "*" - ], - "Access-Control-Allow-Methods": [ - "GET, POST, DELETE, OPTIONS" - ], - "Age": [ - "0" - ], - "Server": [ - "Pubnub Storage" - ], - "Cache-Control": [ - "no-cache" - ], - "Accept-Ranges": [ - "bytes" - ] - }, - "body": { - "string": "{\"error\":false,\"message\":\"OK\",\"service\":\"channel-registry\",\"status\":200}" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v2/subscribe/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/,/0?channel-group=test-subscribe-asyncio-join-leave-cg-group%2Ctest-subscribe-asyncio-join-leave-cg-group-pnpres&ee=1&heartbeat=30&tt=0&uuid=test-subscribe-asyncio-listener", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.0.0" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Date": [ - "Tue, 29 Oct 2024 11:50:13 GMT" - ], - "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" - ], - "Content-Length": [ - "45" - ], - "Connection": [ - "keep-alive" - ], - "Cache-Control": [ - "no-cache" - ], - "Access-Control-Allow-Origin": [ - "*" - ], - "Access-Control-Allow-Methods": [ - "GET" - ] - }, - "body": { - "string": "{\"t\":{\"t\":\"17302025729072975\",\"r\":41},\"m\":[]}" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v2/subscribe/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/,/0?channel-group=test-subscribe-asyncio-join-leave-cg-group%2Ctest-subscribe-asyncio-join-leave-cg-group-pnpres&ee=1&heartbeat=30&tr=41&tt=17302025729072975&uuid=test-subscribe-asyncio-listener", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.0.0" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Date": [ - "Tue, 29 Oct 2024 11:50:14 GMT" - ], - "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" - ], - "Transfer-Encoding": [ - "chunked" - ], - "Connection": [ - "keep-alive" - ], - "Cache-Control": [ - "no-cache" - ], - "Access-Control-Allow-Origin": [ - "*" - ], - "Access-Control-Allow-Methods": [ - "GET" - ], - "Content-Encoding": [ - "gzip" - ] - }, - "body": { - "string": "{\"t\":{\"t\":\"17302026145246029\",\"r\":41},\"m\":[{\"a\":\"2\",\"f\":0,\"p\":{\"t\":\"17302026145246029\",\"r\":42},\"k\":\"sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe\",\"c\":\"test-subscribe-asyncio-join-leave-cg-channel-pnpres\",\"u\":{\"pn_action\":\"join\",\"pn_uuid\":\"test-subscribe-asyncio-listener\",\"pn_timestamp\":1730202614,\"pn_precise_timestamp\":1730202614520,\"pn_occupancy\":1,\"pn_ispresence\":1,\"pn_channel\":\"test-subscribe-asyncio-join-leave-cg-channel\"},\"d\":{\"action\":\"join\",\"uuid\":\"test-subscribe-asyncio-listener\",\"timestamp\":1730202614,\"precise_timestamp\":1730202614520,\"occupancy\":1},\"b\":\"test-subscribe-asyncio-join-leave-cg-group-pnpres\"}]}" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v2/subscribe/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/,/0?channel-group=test-subscribe-asyncio-join-leave-cg-group&ee=1&heartbeat=30&l_cg=0.2459278106689453&tt=0&uuid=test-subscribe-asyncio-messenger", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.0.0" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Date": [ - "Tue, 29 Oct 2024 11:50:14 GMT" - ], - "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" - ], - "Content-Length": [ - "45" - ], - "Connection": [ - "keep-alive" - ], - "Cache-Control": [ - "no-cache" - ], - "Access-Control-Allow-Origin": [ - "*" - ], - "Access-Control-Allow-Methods": [ - "GET" - ] - }, - "body": { - "string": "{\"t\":{\"t\":\"17302026148660004\",\"r\":43},\"m\":[]}" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v2/subscribe/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/,/0?channel-group=test-subscribe-asyncio-join-leave-cg-group%2Ctest-subscribe-asyncio-join-leave-cg-group-pnpres&ee=1&heartbeat=30&tr=41&tt=17302026145246029&uuid=test-subscribe-asyncio-listener", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.0.0" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Date": [ - "Tue, 29 Oct 2024 11:50:15 GMT" - ], - "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" - ], - "Transfer-Encoding": [ - "chunked" - ], - "Connection": [ - "keep-alive" - ], - "Cache-Control": [ - "no-cache" - ], - "Access-Control-Allow-Origin": [ - "*" - ], - "Access-Control-Allow-Methods": [ - "GET" - ], - "Content-Encoding": [ - "gzip" - ] - }, - "body": { - "string": "{\"t\":{\"t\":\"17302026156815862\",\"r\":41},\"m\":[{\"a\":\"2\",\"f\":0,\"p\":{\"t\":\"17302026156815862\",\"r\":43},\"k\":\"sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe\",\"c\":\"test-subscribe-asyncio-join-leave-cg-channel-pnpres\",\"u\":{\"pn_action\":\"join\",\"pn_uuid\":\"test-subscribe-asyncio-messenger\",\"pn_timestamp\":1730202615,\"pn_precise_timestamp\":1730202615678,\"pn_occupancy\":2,\"pn_ispresence\":1,\"pn_channel\":\"test-subscribe-asyncio-join-leave-cg-channel\"},\"d\":{\"action\":\"join\",\"uuid\":\"test-subscribe-asyncio-messenger\",\"timestamp\":1730202615,\"precise_timestamp\":1730202615678,\"occupancy\":2},\"b\":\"test-subscribe-asyncio-join-leave-cg-group-pnpres\"}]}" - } - } - } - ] -}