aboutsummaryrefslogtreecommitdiffstats
path: root/python-twisted/tests
diff options
context:
space:
mode:
authorDevendra2013-07-10 10:39:58 +0530
committerDevendra2013-07-10 10:39:58 +0530
commite65cc45e333cc33d19b97b5f93e69121ca2beffa (patch)
tree284435394f510ab1cd165fdac9b7bded5709dc83 /python-twisted/tests
parentdd2e5481c7b0f96d8caae5a613db0c407711999d (diff)
downloadpubnub-python-e65cc45e333cc33d19b97b5f93e69121ca2beffa.tar.bz2
adding makefiles for version updates
Diffstat (limited to 'python-twisted/tests')
-rw-r--r--python-twisted/tests/unit-test-full.py2
-rw-r--r--python-twisted/tests/unit-test.py15
2 files changed, 14 insertions, 3 deletions
diff --git a/python-twisted/tests/unit-test-full.py b/python-twisted/tests/unit-test-full.py
index f593d11..c5940af 100644
--- a/python-twisted/tests/unit-test-full.py
+++ b/python-twisted/tests/unit-test-full.py
@@ -19,6 +19,8 @@
import sys
sys.path.append('../')
+sys.path.append('./')
+sys.path.append('../common/')
from Pubnub import Pubnub
publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo'
diff --git a/python-twisted/tests/unit-test.py b/python-twisted/tests/unit-test.py
index 843f939..ed7fcd5 100644
--- a/python-twisted/tests/unit-test.py
+++ b/python-twisted/tests/unit-test.py
@@ -11,6 +11,8 @@
import sys
sys.path.append('../')
+sys.path.append('./')
+sys.path.append('../common/')
from Pubnub import Pubnub
publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo'
@@ -23,7 +25,7 @@ ssl_on = len(sys.argv) > 5 and bool(sys.argv[5]) or False
## Initiat Class
## -----------------------------------------------------------------------
pubnub = Pubnub( publish_key, subscribe_key, secret_key, cipher_key, ssl_on )
-crazy = ' ~`!@#$%^&*( 顶顅 Ȓ)+=[]\\{}|;\':",./<>?abcd'
+crazy = 'python-twisted-test-channel'
## ---------------------------------------------------------------------------
## Unit Test Function
@@ -90,10 +92,17 @@ def message_received(message):
'callback' : dumpster
})
+
def connected() :
+ ch = crazy
+ def dump_message( msg):
+ print ch, msg
+ pubnub.unsubscribe({'channel':ch})
+ pubnub.stop()
pubnub.publish({
- 'channel' : crazy,
- 'message' : { 'Info' : 'Connected!' }
+ 'channel' : ch,
+ 'message' : { 'Info' : 'Connected!' },
+ 'callback' : dump_message
})
pubnub.subscribe({