Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved test API keys to a config.py file that is ignored

  • Loading branch information...
commit 00adfed5954e1dc2e758c8d8c4ac200308ebc9f1 1 parent f338cff
@dasevilla authored
Showing with 11 additions and 12 deletions.
  1. +1 −0  .gitignore
  2. +5 −7 tests/basetest.py
  3. +5 −5 tests/shelves.py
View
1  .gitignore
@@ -1,3 +1,4 @@
+tests/config.py
*.py[co]
# Packages
View
12 tests/basetest.py
@@ -1,20 +1,18 @@
import unittest
from goodreads import GoodReadsClient
+import config
class BaseTestCase(unittest.TestCase):
- GOODREADS_API_KEY = "GOODREADS_API_KEY"
- GOODREADS_API_SECRET = "GOODREADS_API_SECRET"
-
def setUp(self):
- self.assertIsNotNone(self.GOODREADS_API_KEY)
- self.assertIsNotNone(self.GOODREADS_API_SECRET)
+ self.assertIsNotNone(config.GOODREADS_API_KEY)
+ self.assertIsNotNone(config.GOODREADS_API_SECRET)
self.client = GoodReadsClient(
- self.GOODREADS_API_KEY,
- self.GOODREADS_API_SECRET)
+ config.GOODREADS_API_KEY,
+ config.GOODREADS_API_SECRET)
def tearDown(self):
self.client = None
View
10 tests/shelves.py
@@ -1,18 +1,18 @@
import unittest
+
import basetest
+import config
class TestShelfs(basetest.BaseTestCase):
- TEST_USER_ID = "GOODREADS_USER_ID"
- TEST_SHELF_NAME = "to-read"
-
def test_user_shelves(self):
- shelfs = self.client.user_shelves(self.TEST_USER_ID)
+ shelfs = self.client.user_shelves(config.TEST_USER_ID)
self.assertIsNotNone(shelfs)
def test_get_shelf(self):
- books = self.client.get_shelf(self.TEST_USER_ID, self.TEST_SHELF_NAME)
+ books = self.client.get_shelf(config.TEST_USER_ID,
+ config.TEST_SHELF_NAME)
self.assertIsNotNone(books)
Please sign in to comment.
Something went wrong with that request. Please try again.