aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/unit-test.py
diff options
context:
space:
mode:
authorDevendra2013-07-10 10:39:58 +0530
committerDevendra2013-07-10 10:39:58 +0530
commite65cc45e333cc33d19b97b5f93e69121ca2beffa (patch)
tree284435394f510ab1cd165fdac9b7bded5709dc83 /python/tests/unit-test.py
parentdd2e5481c7b0f96d8caae5a613db0c407711999d (diff)
downloadpubnub-python-e65cc45e333cc33d19b97b5f93e69121ca2beffa.tar.bz2
adding makefiles for version updates
Diffstat (limited to 'python/tests/unit-test.py')
-rwxr-xr-xpython/tests/unit-test.py25
1 files changed, 7 insertions, 18 deletions
diff --git a/python/tests/unit-test.py b/python/tests/unit-test.py
index 88391a0..1737ace 100755
--- a/python/tests/unit-test.py
+++ b/python/tests/unit-test.py
@@ -9,8 +9,11 @@
## PubNub 3.0 Real-time Push Cloud API
## -----------------------------------
-from Pubnub import Pubnub
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'
subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'demo'
@@ -23,7 +26,7 @@ ssl_on = len(sys.argv) > 4 and bool(sys.argv[4]) or False
## -----------------------------------------------------------------------
pubnub = Pubnub( publish_key, subscribe_key, secret_key, ssl_on )
-crazy = ' ~`!@#$%^&*(顶顅Ȓ)+=[]\\{}|;\':",./<>?abcd'
+crazy = 'demo'
## ---------------------------------------------------------------------------
## Unit Test Function
@@ -37,11 +40,11 @@ def test( trial, name ) :
## -----------------------------------------------------------------------
## Publish Example
## -----------------------------------------------------------------------
-pubish_success = pubnub.publish({
+publish_success = pubnub.publish({
'channel' : crazy,
'message' : crazy
})
-test( pubish_success[0] == 1, 'Publish First Message Success' )
+test( publish_success[0] == 1, 'Publish First Message Success' )
## -----------------------------------------------------------------------
## History Example
@@ -61,17 +64,3 @@ test( len(history) == 1, 'History Message Count' )
## -----------------------------------------------------------------------
timestamp = pubnub.time()
test( timestamp > 0, 'PubNub Server Time: ' + str(timestamp) )
-
-## -----------------------------------------------------------------------
-## Subscribe Example
-## -----------------------------------------------------------------------
-def receive(message) :
- print(message)
- return True
-
-pubnub.subscribe({
- 'channel' : crazy,
- 'callback' : receive
-})
-
-