Skip to content

Commit f241636

Browse files
yukuairoyengelke
authored andcommitted
Fix test for slack slash using knowledge graph API (GoogleCloudPlatform#1613)
* Fix test * remove import os that's no longer needed
1 parent 7cd0268 commit f241636

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

functions/slack/main_test.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,19 @@
1212
# limitations under the License.
1313

1414
import json
15-
import os
1615

1716
import apiclient
1817
import mock
1918
import pytest
2019

2120
import main
2221

23-
API_KEY = os.environ['API_KEY']
24-
2522
with open('config.json', 'r') as f:
2623
data = f.read()
2724
config = json.loads(data)
2825

29-
kg_search = apiclient.discovery.build('kgsearch', 'v1', developerKey=API_KEY)
26+
kg_search = apiclient.discovery.build('kgsearch', 'v1',
27+
developerKey=config['KG_API_KEY'])
3028
example_response = kg_search.entities().search(query='lion', limit=1).execute()
3129

3230

0 commit comments

Comments
 (0)