Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f241636

Browse filesBrowse 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
Copy full SHA for f241636

File tree

Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed

‎functions/slack/main_test.py

Copy file name to clipboardExpand all lines: functions/slack/main_test.py
+2-4Lines changed: 2 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.