aboutsummaryrefslogtreecommitdiffstats
path: root/python-twisted
diff options
context:
space:
mode:
Diffstat (limited to 'python-twisted')
-rw-r--r--python-twisted/Makefile18
-rw-r--r--python-twisted/Pubnub.py1
-rw-r--r--python-twisted/tests/unit-test-full.py2
-rw-r--r--python-twisted/tests/unit-test.py15
4 files changed, 32 insertions, 4 deletions
diff --git a/python-twisted/Makefile b/python-twisted/Makefile
new file mode 100644
index 0000000..4cd9305
--- /dev/null
+++ b/python-twisted/Makefile
@@ -0,0 +1,18 @@
+include ../Makefile.inc
+
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+ find -name "Pubnub*py" | xargs sed -i "s/PubNub\ [0-9]\.[0-9]\.[0-9]/PubNub\ $(VERSION)/g"
+
+
+.PHONY: clean
+clean:
+
+.PHONY: test
+test:
+ python tests/unit-test.py
+
diff --git a/python-twisted/Pubnub.py b/python-twisted/Pubnub.py
index 247c4ff..e317a9c 100644
--- a/python-twisted/Pubnub.py
+++ b/python-twisted/Pubnub.py
@@ -81,7 +81,6 @@ class Pubnub(PubnubCoreAsync):
contextFactory = WebClientContextFactory(),
pool = self.ssl and None or pnconn_pool
)), [('gzip', GzipDecoder)])
- print url
request = agent.request( 'GET', url, Headers(self.headers), None )
def received(response):
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({