From 6616acbec40ac039b7bdabf7e8b3581e68c0b2cb Mon Sep 17 00:00:00 2001 From: Devendra Date: Fri, 12 Jul 2013 10:14:21 +0530 Subject: adding common test from tornado and twisted --- common/PubnubBase.py | 2 +- common/PubnubCore.py | 2 +- common/PubnubCoreAsync.py | 13 ++++++------- common/PubnubCrypto.py | 2 +- common/unit-test-async.py | 1 - 5 files changed, 9 insertions(+), 11 deletions(-) (limited to 'common') diff --git a/common/PubnubBase.py b/common/PubnubBase.py index b5da9fa..0c4efef 100644 --- a/common/PubnubBase.py +++ b/common/PubnubBase.py @@ -6,7 +6,7 @@ ## http://www.pubnub.com/ ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API ## ----------------------------------- try: import json diff --git a/common/PubnubCore.py b/common/PubnubCore.py index 9b32de7..5965740 100644 --- a/common/PubnubCore.py +++ b/common/PubnubCore.py @@ -6,7 +6,7 @@ ## http://www.pubnub.com/ ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API ## ----------------------------------- try: import json diff --git a/common/PubnubCoreAsync.py b/common/PubnubCoreAsync.py index 5b8d130..8150bde 100644 --- a/common/PubnubCoreAsync.py +++ b/common/PubnubCoreAsync.py @@ -6,7 +6,7 @@ ## http://www.pubnub.com/ ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API ## ----------------------------------- import sys import json @@ -142,16 +142,15 @@ class PubnubCoreAsync(PubnubBase): return def sub_callback(response): - print response - response = json.loads(response) + if not self.subscriptions[channel]['first'] : + self.subscriptions[channel]['first'] = True + connectcb() + ## STOP CONNECTION? if not self.subscriptions[channel]['connected']: return - ## CONNECTED CALLBACK - if not self.subscriptions[channel]['first'] : - self.subscriptions[channel]['first'] = True - connectcb() + ## PROBLEM? if not response: diff --git a/common/PubnubCrypto.py b/common/PubnubCrypto.py index b452765..b91e2d9 100644 --- a/common/PubnubCrypto.py +++ b/common/PubnubCrypto.py @@ -6,7 +6,7 @@ ## http://www.pubnub.com/ ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API ## ----------------------------------- from Crypto.Cipher import AES diff --git a/common/unit-test-async.py b/common/unit-test-async.py index 258bf6a..89a828e 100644 --- a/common/unit-test-async.py +++ b/common/unit-test-async.py @@ -93,7 +93,6 @@ def test_subscribe(): 'callback' : publish_cb }) def subscribe_cb(response): - print response test(response == message , 'Subscribe Receive Test in subscribe Callback') pubnub.subscribe({ 'channel' : crazy, -- cgit v1.2.3