Skip to content

Commit 87c3706

Browse files
committed
fixed some small things
1 parent 7acde58 commit 87c3706

5 files changed

Lines changed: 29 additions & 14 deletions

File tree

‎CHANGELOG‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
Change history
33
================
44

5+
2.0.0
6+
=====
7+
:release-date: 2014-11-10
8+
:by: Thierry Schellenbach
9+
10+
* Breaking change: New style feed syntax, client.feed('user', '1') instead of client.feed('user:3')
11+
* Breaking change: New style follow syntax, feed.follow('user', 3)
12+
* API versioning support
13+
* Configurable timeouts
14+
* Python 3 support
15+
16+
517
1.1.1
618
=====
719
:release-date: 2014-09-20 08:00 A.M GMT

‎stream/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
__copyright__ = 'Copyright 2014, Thierry Schellenbach'
66
__credits__ = ['Thierry Schellenbach, mellowmorning.com, @tschellenbach']
77
__license__ = 'BSD'
8-
__version__ = '1.2.0'
8+
__version__ = '2.0.0'
99
__maintainer__ = 'Thierry Schellenbach'
1010
__email__ = 'thierryschellenbach@gmail.com'
1111
__status__ = 'Production'

‎stream/client.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, api_key, api_secret, app_id, version='v1.0', timeout=3.0, bas
3939
'''
4040
self.api_key = api_key
4141
self.api_secret = api_secret
42-
self.site_id = app_id
42+
self.app_id = app_id
4343
self.version = version
4444
self.timeout = timeout
4545
if base_url is not None:
@@ -57,6 +57,8 @@ def feed(self, feed_slug, user_id):
5757
:param user_id: the user id
5858
'''
5959
from stream.feed import Feed
60+
user_id = str(user_id)
61+
feed_slug = str(feed_slug)
6062

6163
# generate the token
6264
feed_id = '%s%s' % (feed_slug, user_id)

‎stream/feed.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ def __init__(self, client, feed_slug, user_id, token):
88
Initializes the Feed class
99
1010
:param client: the api client
11-
:param feed_slug: the slug of the feed, ie user, flat, notification
11+
:param slug: the slug of the feed, ie user, flat, notification
1212
:param user_id: the id of the user
1313
:param token: the token
1414
'''
1515
self.client = client
16-
self.feed_slug = feed_slug
17-
self.user_id = user_id
16+
self.slug = feed_slug
17+
self.user_id = str(user_id)
1818
self.id = '%s:%s' % (feed_slug, user_id)
1919
self.token = token
2020

‎stream/tests.py‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ def connect_debug():
1616
u'gthc2t9gh7pzq52f6cky8w4r4up9dr6rju9w3fjgmkv6cdvvav2ufe5fv7e2r9qy'
1717
)
1818

19+
random_postfix = str(random.randint(0, 1000000))
1920
client = connect_debug()
20-
user1 = client.feed('user', '1')
21-
user2 = client.feed('user', '2')
22-
aggregated2 = client.feed('aggregated', '2')
23-
aggregated3 = client.feed('aggregated', '3')
24-
topic1 = client.feed('topic', '1')
25-
flat3 = client.feed('flat', '3')
21+
user1 = client.feed('user', '1' + random_postfix)
22+
user2 = client.feed('user', '2' + random_postfix)
23+
aggregated2 = client.feed('aggregated', '2' + random_postfix)
24+
aggregated3 = client.feed('aggregated', '3' + random_postfix)
25+
topic1 = client.feed('topic', '1' + random_postfix)
26+
flat3 = client.feed('flat', '3' + random_postfix)
2627

2728

2829
class ClientTest(TestCase):
@@ -43,7 +44,7 @@ def test_heroku(self):
4344
client = stream.connect()
4445
self.assertEqual(client.api_key, 'thierry')
4546
self.assertEqual(client.api_secret, 'pass')
46-
self.assertEqual(client.site_id, '1')
47+
self.assertEqual(client.app_id, '1')
4748

4849
def test_heroku_real(self):
4950
url = 'https://bvt88g4kvc63:twc5ywfste5bm2ngqkzs7ukxk3pn96yweghjrxcmcrarnt3j4dqj3tucbhym5wfd@getstream.io/?app=669'
@@ -52,15 +53,15 @@ def test_heroku_real(self):
5253
self.assertEqual(client.api_key, 'bvt88g4kvc63')
5354
self.assertEqual(
5455
client.api_secret, 'twc5ywfste5bm2ngqkzs7ukxk3pn96yweghjrxcmcrarnt3j4dqj3tucbhym5wfd')
55-
self.assertEqual(client.site_id, '669')
56+
self.assertEqual(client.app_id, '669')
5657

5758
def test_heroku_overwrite(self):
5859
url = 'https://thierry:pass@getstream.io/?app=1'
5960
os.environ['STREAM_URL'] = url
6061
client = stream.connect('a', 'b', 'c')
6162
self.assertEqual(client.api_key, 'a')
6263
self.assertEqual(client.api_secret, 'b')
63-
self.assertEqual(client.site_id, 'c')
64+
self.assertEqual(client.app_id, 'c')
6465

6566
def test_token_retrieval(self):
6667
self.user1.token

0 commit comments

Comments
 (0)