From 276bf54fcccd73cf694487d59e9e3319b8bd8616 Mon Sep 17 00:00:00 2001 From: Devendra Date: Fri, 19 Jun 2015 03:27:23 +0530 Subject: history fix --- python/tests/test_history.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'python/tests') diff --git a/python/tests/test_history.py b/python/tests/test_history.py index 3cf8e03..1592e11 100644 --- a/python/tests/test_history.py +++ b/python/tests/test_history.py @@ -6,6 +6,7 @@ from nose.tools import with_setup pubnub = Pubnub("ds","ds") pubnub_enc = Pubnub(publish_key="ds",subscribe_key="ds",cipher_key="enigma") +pubnub_pam = Pubnub(publish_key="pam", subscribe_key="pam", secret_key="pam") def rand(msg): @@ -13,6 +14,7 @@ def rand(msg): channel = rand("channel") channel_enc = rand("channel_enc") +channel_pam = rand("channel_pam") messages = [] @@ -21,8 +23,10 @@ def setup_func(): for i in range(0,20): msg = rand("message-" + str(i)) messages.append(msg) + pubnub_pam.grant(channel=channel_pam, read=True, write=True, ttl=144000) pubnub.publish(channel=channel, message=msg) pubnub_enc.publish(channel=channel_enc, message=msg) + pubnub_pam.publish(channel=channel_pam, message=msg) @with_setup(setup_func) @@ -30,8 +34,13 @@ def test_1(): time.sleep(3) hresp = pubnub.history(channel=channel, count=20) hresp2 = pubnub_enc.history(channel=channel_enc, count=20) + hresp3 = pubnub_pam.history(channel=channel_pam, count=20) + hresp4 = pubnub_pam.history(channel=channel_pam + "no_rw", count=20) assert hresp[0] == messages assert hresp2[0] == messages + assert hresp3[0] == messages + assert hresp4['message'] == 'Forbidden' + assert channel_pam + "no_rw" in hresp4['payload']['channels'] -- cgit v1.2.3