diff options
| author | Devendra | 2014-03-24 19:17:48 +0530 | 
|---|---|---|
| committer | Devendra | 2014-03-24 19:17:48 +0530 | 
| commit | 80edcffbfe140a6d19c65deca24e1ba1c0f49b99 (patch) | |
| tree | 4ece6bf2a480866f1028a5765a1fac0cabb68752 /python/tests | |
| parent | 0874d7b862d8cff1c6d01f3d804a2509e181c959 (diff) | |
| download | pubnub-python-80edcffbfe140a6d19c65deca24e1ba1c0f49b99.tar.bz2 | |
support for python3
Diffstat (limited to 'python/tests')
| -rwxr-xr-x | python/tests/detailed-history-unit-test.py | 24 | ||||
| -rwxr-xr-x | python/tests/unit-test.py | 3 | 
2 files changed, 14 insertions, 13 deletions
| diff --git a/python/tests/detailed-history-unit-test.py b/python/tests/detailed-history-unit-test.py index 31bdef8..b1500b4 100755 --- a/python/tests/detailed-history-unit-test.py +++ b/python/tests/detailed-history-unit-test.py @@ -14,7 +14,7 @@ sys.path.append('.')  sys.path.append('..')  sys.path.append('../common')  from Pubnub import Pubnub -import unittest2 as unittest +import unittest as unittest  publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' @@ -37,7 +37,7 @@ class TestDetailedHistory(unittest.TestCase):      @classmethod      def publish_msg(cls, start, end, offset): -        print 'Publishing messages' +        print('Publishing messages')          inputs = []          for i in range(start + offset, end + offset):              message = str(i) + " " + crazy @@ -47,19 +47,19 @@ class TestDetailedHistory(unittest.TestCase):                                       })              t = pubnub.time()              inputs.append({'timestamp': t, 'message': message}) -            print 'Message # ', i, ' published' +            print(('Message # ' + i + ' published'))          return inputs      @classmethod -    def setUpClass(cls): -        print 'Setting up context for Detailed History tests. Please wait ...' -        cls.starttime = pubnub.time() -        cls.inputs = cls.inputs + cls.publish_msg(0, cls.total_msg / 2, 0) -        cls.midtime = pubnub.time() -        cls.inputs = cls.inputs + cls.publish_msg( -            0, cls.total_msg / 2, cls.total_msg / 2) -        cls.endtime = pubnub.time() -        print 'Context setup for Detailed History tests. Now running tests' +    def setUpClass(c): +        print('Setting up context for Detailed History tests. Please wait ...') +        c.starttime = pubnub.time() +        c.inputs = c.inputs + c.publish_msg(0, c.total_msg / 2, 0) +        c.midtime = pubnub.time() +        c.inputs = c.inputs + c.publish_msg( +            0, c.total_msg / 2, c.total_msg / 2) +        c.endtime = pubnub.time() +        print('Context setup for Detailed History tests. Now running tests')      def test_begin_to_end_count(self):          count = 5 diff --git a/python/tests/unit-test.py b/python/tests/unit-test.py index 1737ace..762959e 100755 --- a/python/tests/unit-test.py +++ b/python/tests/unit-test.py @@ -53,8 +53,9 @@ history = pubnub.history({      'channel' : crazy,      'limit'   : 1  }) +  test( -    history[0].encode('utf-8') == crazy, +    history[0] == crazy,      'History Message: ' + history[0]  )  test( len(history) == 1, 'History Message Count' ) | 
