Skip to content

Commit 15cbc11

Browse files
committed
Merge pull request #6 from BlockScore/v3
V3
2 parents 40a81a5 + a2c33de commit 15cbc11

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ pip-log.txt
1818
.coverage
1919
.tox
2020
nosetests.xml
21+
*.sublime-workspace

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ verification = verification.body
4545
### Create a new verification
4646

4747
```python
48-
verification = client.verification.create('us_citizen','1980-01-01',{'ssn': '0000'},{'first': 'john', 'last': 'doe'},{'street1': '1 Infinite Loop', 'city': 'Palo Alto', 'state': 'ca', 'postal_code': '94309', 'country': 'us'})
48+
verification = client.verification.create('1980-01-01',{'ssn': '0000'},{'first': 'john', 'last': 'doe'},{'street1': '1 Infinite Loop', 'city': 'Palo Alto', 'state': 'ca', 'postal_code': '94309', 'country_code': 'us'})
4949
verification = verification.body
5050
```
5151

blockscore/api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Import all the classes into api module
2-
from . import verifications
3-
from . import questions
2+
from . import verification
3+
from . import question_set

blockscore/api/verification.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ def __init__(self, client):
88
#
99
# '/verifications' POST
1010
#
11-
# type -
1211
# date_of_birth -
1312
# identification -
1413
# name -
1514
# address -
16-
def create(self, type, date_of_birth, identification, name, address, options = {}):
15+
def create(self, date_of_birth, identification, name, address, options = {}):
1716
body = options['body'] if 'body' in options else {}
18-
body['type'] = type
1917
body['date_of_birth'] = date_of_birth
2018
body['identification'] = identification
2119
body['name'] = name

blockscore/http_client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ def __init__(self, auth, options):
2020

2121
self.options = {
2222
'base': 'https://api.blockscore.com/',
23-
'user_agent': 'blockscore-python/1.0.0 (https://github.com/BlockScore/blockscore-python)'
23+
'user_agent': 'blockscore-python/3.0.0 (https://github.com/BlockScore/blockscore-python)'
2424
}
2525

2626
self.options.update(options)
2727

2828
self.base = self.options['base']
2929

3030
self.headers = {
31-
'Accept': 'application/vnd.blockscore+json;version=2',
31+
'Accept': 'application/vnd.blockscore+json;version=3',
3232
'user-agent': self.options['user_agent']
3333
}
3434

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name='blockscore',
11-
version='1.0.0',
11+
version='3.0.0',
1212
description='Official BlockScore API library client for python',
1313
author='John Backus',
1414
author_email='[email protected]',

test/verifications.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ class TestBlockscore(unittest.TestCase):
99

1010
def setUp(self):
1111
try:
12-
self.client = blockscore.Client({'api_key': 'your_api_key'})
12+
self.client = blockscore.Client({'api_key': os.environ['BLOCKSCORE_API']})
1313
except KeyError:
1414
sys.stderr.write("To run tests, you must have a BLOCKSCORE_API environment variable with a test api key\n")
1515
sys.exit(2)
16-
self.test_identity = ['us_citizen','1980-01-01',{'ssn': '0000'},{'first': 'john', 'last': 'doe'},{'street1': '1 Infinite Loop', 'city': 'Palo Alto', 'state': 'ca', 'postal_code': '94309', 'country': 'us'}]
16+
self.test_identity = ['1980-01-01',{'ssn': '0000'},{'first': 'john', 'last': 'doe'},{'street1': '1 Infinite Loop', 'city': 'Palo Alto', 'state': 'ca', 'postal_code': '94309', 'country_code': 'us'}]
1717

1818
def test_create_verification(self):
1919
verif = self.client.verification.create(*self.test_identity)
20-
self.assertEqual(verif.body['date_of_birth'], self.test_identity[1])
20+
self.assertEqual(verif.body['date_of_birth'], self.test_identity[0])
2121

2222
def test_retrieve_verification(self):
2323
verif = self.client.verification.create(*self.test_identity)
@@ -52,7 +52,7 @@ def test_score_questions(self):
5252
verif_id = verif['id']
5353
qset = self.client.question_set.create(verif_id)
5454
qset = qset.body
55-
qset_id = qset['question_set_id']
55+
qset_id = qset['id']
5656
score = self.client.question_set.score(verif_id, qset_id, [
5757
{'question_id':1, 'answer_id':1},
5858
{'question_id':2, 'answer_id':1},
@@ -61,7 +61,7 @@ def test_score_questions(self):
6161
{'question_id':5, 'answer_id':1}
6262
])
6363
score = score.body
64-
self.assertEqual(score['question_set_id'],qset_id)
64+
self.assertEqual(score['id'],qset_id)
6565
self.assertIsInstance(score['score'],float)
6666

6767

0 commit comments

Comments
 (0)