Skip to content

Commit 46cf23a

Browse files
committed
Tests: Use encrypted API keys
1 parent 107494c commit 46cf23a

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎stream/tests.py‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import json
99

1010
import os
11+
import sys
1112
import datetime
1213
import copy
1314
import requests
@@ -21,9 +22,20 @@
2122

2223

2324
def connect_debug():
25+
try:
26+
key = os.environ['STREAM_KEY']
27+
secret = os.environ['STREAM_SECRET']
28+
except KeyError:
29+
print('To run the tests the STREAM_KEY and STREAM_SECRET variables '
30+
'need to be available. \n'
31+
'Please create a pull request if you are an external '
32+
'contributor, because these variables are automatically added '
33+
'by Travis.')
34+
sys.exit(1)
35+
2436
return stream.connect(
25-
'q56mdvdzreye',
26-
'spmf6x2b2v2tqg93sfp5t393wfcxru58zm7jr3ynf7dmmndw5y8chux25hs63znf',
37+
key,
38+
secret,
2739
location='us-east',
2840
timeout=10
2941
)

0 commit comments

Comments
 (0)