Skip to content

Commit 97a9fca

Browse files
committed
Changed the way user inputs api_key
Now do ```python import blockscore blockscore.api_key = 'your_api_key' ```
1 parent 32ea169 commit 97a9fca

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

blockscore/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
from .client import Client
2+
api_key = None # use blockscore.api_key = 'your_api_key' after importing blockscore

test/verifications.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
import unittest
66
import os, sys
77

8+
blockscore.api_key = 'your_api_key'
9+
810
class TestBlockscore(unittest.TestCase):
911

1012
def setUp(self):
1113
try:
12-
api_key = os.environ['BLOCKSCORE_API']
14+
api_key = blockscore.api_key
1315
self.client = blockscore.Client({'api_key':api_key})
1416
except KeyError:
1517
sys.stderr.write("To run tests, you must have a BLOCKSCORE_API environment variable with a test api key\n")
@@ -23,7 +25,7 @@ def test_create_verification(self):
2325
def test_retrieve_verification(self):
2426
verif = self.client.verification.create(*self.test_identity)
2527
verif_id = verif.body['id']
26-
verif2 = self.client.verifications().retrieve(verif_id)
28+
verif2 = self.client.verification.retrieve(verif_id)
2729
self.assertEqual(verif.body, verif2.body)
2830

2931
def test_list_verification(self):

0 commit comments

Comments
 (0)