Permalink
Browse files

Use an env var instead of a file for hiding my API key

  • Loading branch information...
Steph Samson
Steph Samson committed Oct 22, 2014
1 parent 360d658 commit f9b6abc228dcc1d79e69263a8c9b8381e6d91a98
Showing with 2 additions and 3 deletions.
  1. +0 −1 .gitignore
  2. +2 −2 tests/pygtaw_test.py
View
@@ -1,5 +1,4 @@
*.pyc
tests/key
build
dist
pygtaw.egg-info
View
@@ -1,4 +1,5 @@
import unittest
import os
from pygtaw import wrapper
class TestPyGoogleTranslateAPIWrapper(unittest.TestCase):
@@ -7,8 +8,7 @@ def setUp(self):
self.make_client()
def make_client(self):
api_key = open('key').read()
self.client = wrapper.Client(api_key)
self.client = wrapper.Client(os.environ['TRANSLATE_KEY'])
def test_get_translated_text(self):
query = self.client.translate('Hola', 'English')

0 comments on commit f9b6abc

Please sign in to comment.