aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevendra2015-06-19 23:28:23 +0530
committerDevendra2015-06-19 23:28:23 +0530
commit4c2bb361dcad44226d37cfdb6b8f9d3e2f6789ff (patch)
tree5b84abe5a379e32fb625f1aabe48ebab0889134a
parent276bf54fcccd73cf694487d59e9e3319b8bd8616 (diff)
downloadpubnub-python-4c2bb361dcad44226d37cfdb6b8f9d3e2f6789ff.tar.bz2
adding include_token test
-rw-r--r--python/tests/test_history.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/python/tests/test_history.py b/python/tests/test_history.py
index 1592e11..a5feb37 100644
--- a/python/tests/test_history.py
+++ b/python/tests/test_history.py
@@ -42,5 +42,17 @@ def test_1():
assert hresp4['message'] == 'Forbidden'
assert channel_pam + "no_rw" in hresp4['payload']['channels']
-
-
+def test_2():
+ time.sleep(3)
+ hresp = pubnub.history(channel=channel, count=20, include_token=True)
+ hresp2 = pubnub_enc.history(channel=channel_enc, count=20, include_token=True)
+ hresp3 = pubnub_pam.history(channel=channel_pam, count=20, include_token=True)
+ hresp4 = pubnub_pam.history(channel=channel_pam + "no_rw", count=20, include_token=True)
+ assert len(hresp[0]) == len(messages)
+ assert hresp[0][0]['timetoken']
+ assert len(hresp2[0]) == len(messages)
+ assert hresp2[0][0]['timetoken']
+ assert len(hresp3[0]) == len(messages)
+ assert hresp3[0][0]['timetoken']
+ assert hresp4['message'] == 'Forbidden'
+ assert channel_pam + "no_rw" in hresp4['payload']['channels']