Skip to content

Commit

Permalink
Merge pull request #364 from JMensch/test-updates
Browse files Browse the repository at this point in the history
Update oath2client credential loading in tests.
  • Loading branch information
msuozzo committed Mar 17, 2016
2 parents 6d96858 + 012a621 commit f5c874b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
except ImportError:
import configparser as ConfigParser

from oauth2client.client import SignedJwtAssertionCredentials
from oauth2client.service_account import ServiceAccountCredentials

import gspread

Expand All @@ -35,10 +35,7 @@ def read_config(filename):


def read_credentials(filename):
creds_data = json.load(open(filename))
return SignedJwtAssertionCredentials(creds_data['client_email'],
creds_data['private_key'].encode(),
SCOPE)
return ServiceAccountCredentials.from_json_keyfile_name(filename, SCOPE)


def gen_value(prefix=None):
Expand Down Expand Up @@ -124,7 +121,7 @@ def test_worksheet(self):
self.assertTrue(isinstance(sheet, gspread.Worksheet))

def test_worksheet_iteration(self):
self.assertEqual(self.spreadsheet.worksheets(),
self.assertEqual(self.spreadsheet.worksheets(),
[sheet for sheet in self.spreadsheet])


Expand Down

0 comments on commit f5c874b

Please sign in to comment.