diff options
| author | Devendra | 2013-07-10 10:39:58 +0530 | 
|---|---|---|
| committer | Devendra | 2013-07-10 10:39:58 +0530 | 
| commit | e65cc45e333cc33d19b97b5f93e69121ca2beffa (patch) | |
| tree | 284435394f510ab1cd165fdac9b7bded5709dc83 /python | |
| parent | dd2e5481c7b0f96d8caae5a613db0c407711999d (diff) | |
| download | pubnub-python-e65cc45e333cc33d19b97b5f93e69121ca2beffa.tar.bz2 | |
adding makefiles for version updates
Diffstat (limited to 'python')
| -rw-r--r-- | python/Makefile | 19 | ||||
| -rw-r--r-- | python/Pubnub.py | 2 | ||||
| -rwxr-xr-x | python/tests/detailed-history-unit-test.py (renamed from python/examples/detailed-history-unit-test.py) | 5 | ||||
| -rwxr-xr-x | python/tests/unit-test.py | 25 | 
4 files changed, 31 insertions, 20 deletions
| diff --git a/python/Makefile b/python/Makefile new file mode 100644 index 0000000..9551bb7 --- /dev/null +++ b/python/Makefile @@ -0,0 +1,19 @@ +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/detailed-history-unit-test.py +	python tests/unit-test.py + diff --git a/python/Pubnub.py b/python/Pubnub.py index 6143b0b..0a6d877 100644 --- a/python/Pubnub.py +++ b/python/Pubnub.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/python/examples/detailed-history-unit-test.py b/python/tests/detailed-history-unit-test.py index 2169e52..31bdef8 100755 --- a/python/examples/detailed-history-unit-test.py +++ b/python/tests/detailed-history-unit-test.py @@ -9,9 +9,12 @@  ## PubNub 3.0 Real-time Push Cloud API  ## ----------------------------------- +import sys +sys.path.append('.') +sys.path.append('..') +sys.path.append('../common')  from Pubnub import Pubnub  import unittest2 as unittest -import sys  publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' 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  -}) - - | 
