Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a9c896

Browse files
Merge pull request GetStream#63 from GetStream/feat/update-dot-com-domain-2
Feat/update dot com domain
2 parents 48ba762 + 55deb5b commit 2a9c896

File tree

5 files changed

+32
-24
lines changed

5 files changed

+32
-24
lines changed

.travis.yml

-12
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,9 @@ python:
77
- 3.4
88
- 3.5
99
- 3.6
10-
# These are allowed to fail
11-
- '3.5-dev' # 3.5 development branch
12-
- '3.6-dev' # 3.6 development branch
13-
- 'nightly' # currently points to 3.7-dev
14-
- 'pypy'
15-
- 'pypy3.3-5.2-alpha1'
1610

1711
matrix:
1812
fast_finish: true
19-
allow_failures:
20-
- python: '3.5-dev' # 3.5 development branch
21-
- python: '3.6-dev' # 3.6 development branch
22-
- python: 'nightly'
23-
- python: 'pypy'
24-
- python: 'pypy3.3-5.2-alpha1'
2513

2614
cache: pip
2715
notifications:

setup.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@
2626
.. _`Github`: https://github.com/GetStream/stream-python
2727
'''
2828

29+
requests = 'requests>=2.3.0,<3'
30+
31+
if sys.version_info < (2, 7, 9):
32+
requests = 'requests[security]>=2.4.1,<3'
33+
2934
install_requires = [
3035
'pyjwt==1.3.0',
31-
'requests>=2.2.1',
36+
requests,
3237
'six>=1.8.0',
3338
'httpsig==1.1.2'
3439
]
3540

36-
3741
class PyTest(TestCommand):
3842

3943
def finalize_options(self):

stream/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def connect(api_key=None, api_secret=None, app_id=None, version='v1.0',
2929
result = pattern.match(stream_url)
3030
if result and len(result.groups()) == 4:
3131
api_key, api_secret, location, app_id = result.groups()
32-
location = None if location == 'getstream' else location
32+
location = None if location in ('getstream', 'stream-io-api') else location
3333
else:
3434
raise ValueError('Invalid api key or heroku url')
3535

stream/client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
class StreamClient(object):
20-
base_url = 'https://api.getstream.io/api/'
20+
base_url = 'https://api.stream-io-api.com/api/'
2121

2222
def __init__(self, api_key, api_secret, app_id, version='v1.0', timeout=6.0, base_url=None, location=None):
2323
'''
@@ -57,9 +57,9 @@ def __init__(self, api_key, api_secret, app_id, version='v1.0', timeout=6.0, bas
5757
elif base_url is not None:
5858
self.base_url = base_url
5959
elif location is not None:
60-
self.base_url = 'https://%s-api.getstream.io/api/' % location
60+
self.base_url = 'https://%s-api.stream-io-api.com/api/' % location
6161

62-
self.base_analytics_url = 'https://analytics.getstream.io/analytics/'
62+
self.base_analytics_url = 'https://analytics.stream-io-api.com/analytics/'
6363

6464
self.session = requests.Session()
6565
# TODO: turn this back on after we verify it doesnt retry on slower requests

stream/tests.py

+22-6
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def connect_debug():
4444
secret,
4545
location='us-east',
4646
timeout=30,
47-
base_url='http://qa-api.getstream.io/api/',
47+
base_url='https://qa.stream-io-api.com/api/',
4848
# base_url='http://localhost-api.getstream.io:8000/api/',
4949
)
5050

@@ -174,7 +174,7 @@ def test_heroku(self):
174174
self.assertEqual(client.app_id, '1')
175175

176176
def test_heroku_no_location(self):
177-
url = 'https://bvt88g4kvc63:twc5ywfste5bm2ngqkzs7ukxk3pn96yweghjrxcmcrarnt3j4dqj3tucbhym5wfd@getstream.io/?app_id=669'
177+
url = 'https://bvt88g4kvc63:twc5ywfste5bm2ngqkzs7ukxk3pn96yweghjrxcmcrarnt3j4dqj3tucbhym5wfd@stream-io-api.com/?app_id=669'
178178
os.environ['STREAM_URL'] = url
179179
client = stream.connect()
180180
self.assertEqual(client.api_key, 'bvt88g4kvc63')
@@ -187,9 +187,9 @@ def test_heroku_no_location(self):
187187
client.base_url, 'http://localhost:8000/api/')
188188
else:
189189
self.assertEqual(
190-
client.base_url, 'https://api.getstream.io/api/')
190+
client.base_url, 'https://api.stream-io-api.com/api/')
191191

192-
def test_heroku_location(self):
192+
def test_heroku_location_compat(self):
193193
url = 'https://ahj2ndz7gsan:gthc2t9gh7pzq52f6cky8w4r4up9dr6rju9w3fjgmkv6cdvvav2ufe5fv7e2r9qy@us-east.getstream.io/?app_id=1'
194194
os.environ['STREAM_URL'] = url
195195
client = stream.connect()
@@ -202,7 +202,23 @@ def test_heroku_location(self):
202202
client.base_url, 'http://localhost:8000/api/')
203203
else:
204204
self.assertEqual(
205-
client.base_url, 'https://us-east-api.getstream.io/api/')
205+
client.base_url, 'https://us-east-api.stream-io-api.com/api/')
206+
self.assertEqual(client.app_id, '1')
207+
208+
def test_heroku_location(self):
209+
url = 'https://ahj2ndz7gsan:gthc2t9gh7pzq52f6cky8w4r4up9dr6rju9w3fjgmkv6cdvvav2ufe5fv7e2r9qy@us-east.stream-io-api.com/?app_id=1'
210+
os.environ['STREAM_URL'] = url
211+
client = stream.connect()
212+
self.assertEqual(client.api_key, 'ahj2ndz7gsan')
213+
self.assertEqual(
214+
client.api_secret, 'gthc2t9gh7pzq52f6cky8w4r4up9dr6rju9w3fjgmkv6cdvvav2ufe5fv7e2r9qy')
215+
216+
if self.local_tests:
217+
self.assertEqual(
218+
client.base_url, 'http://localhost:8000/api/')
219+
else:
220+
self.assertEqual(
221+
client.base_url, 'https://us-east-api.stream-io-api.com/api/')
206222
self.assertEqual(client.app_id, '1')
207223

208224
def test_heroku_overwrite(self):
@@ -216,7 +232,7 @@ def test_heroku_overwrite(self):
216232
def test_location_support(self):
217233
client = stream.connect('a', 'b', 'c', location='us-east')
218234

219-
full_location = 'https://us-east-api.getstream.io/api/'
235+
full_location = 'https://us-east-api.stream-io-api.com/api/'
220236
if self.local_tests:
221237
full_location = 'http://localhost:8000/api/'
222238

0 commit comments

Comments
 (0)