Skip to content

Commit 3aa0c0f

Browse files
committed
fix tabstop in test files
1 parent 8cf8765 commit 3aa0c0f

File tree

2 files changed

+142
-142
lines changed

2 files changed

+142
-142
lines changed

test/companies.py

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
11
if __name__ == '__main__' and __package__ is None:
2-
from os import sys, path
3-
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
2+
from os import sys, path
3+
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
44
import blockscore
55
import unittest
66
import os, sys
77

88
class TestBlockscoreCompanies(unittest.TestCase):
99

10-
def setUp(self):
11-
try:
12-
self.client = blockscore.Client({'api_key': os.environ['BLOCKSCORE_API']})
13-
except KeyError:
14-
sys.stderr.write("To run tests, you must have a BLOCKSCORE_API environment variable with a test api key\n")
15-
sys.exit(2)
10+
def setUp(self):
11+
try:
12+
self.client = blockscore.Client({'api_key': os.environ['BLOCKSCORE_API']})
13+
except KeyError:
14+
sys.stderr.write("To run tests, you must have a BLOCKSCORE_API environment variable with a test api key\n")
15+
sys.exit(2)
1616

17-
self.test_company = {
18-
"entity_name": "BlockScore",
19-
"tax_id": "123410000",
20-
"incorporation_date": "1980-08-25",
21-
"incorporation_state": "DE",
22-
"incorporation_country_code": "US",
23-
"incorporation_type": "corporation",
24-
"dbas": "BitRemite",
25-
"registration_number": "123123123",
26-
"email": "[email protected]",
27-
"url": "https://blockscore.com",
28-
"phone_number": "6505555555",
29-
"ip_address": "67.160.8.182",
30-
"address_street1": "1 Infinite Loop",
31-
"address_street2": None,
32-
"address_city": "Cupertino",
33-
"address_subdivision": "CA",
34-
"address_postal_code": "95014",
35-
"address_country_code": "US",
36-
}
17+
self.test_company = {
18+
"entity_name": "BlockScore",
19+
"tax_id": "123410000",
20+
"incorporation_date": "1980-08-25",
21+
"incorporation_state": "DE",
22+
"incorporation_country_code": "US",
23+
"incorporation_type": "corporation",
24+
"dbas": "BitRemite",
25+
"registration_number": "123123123",
26+
"email": "[email protected]",
27+
"url": "https://blockscore.com",
28+
"phone_number": "6505555555",
29+
"ip_address": "67.160.8.182",
30+
"address_street1": "1 Infinite Loop",
31+
"address_street2": None,
32+
"address_city": "Cupertino",
33+
"address_subdivision": "CA",
34+
"address_postal_code": "95014",
35+
"address_country_code": "US",
36+
}
3737

38-
def test_list_companies(self):
39-
response = self.client.companies.all()
40-
self.assertEqual(200, response.code)
38+
def test_list_companies(self):
39+
response = self.client.companies.all()
40+
self.assertEqual(200, response.code)
4141

42-
response = self.client.companies.all(count=2)
43-
self.assertEqual(200, response.code)
42+
response = self.client.companies.all(count=2)
43+
self.assertEqual(200, response.code)
4444

45-
response = self.client.companies.all(count=2, offset=2)
46-
self.assertEqual(200, response.code)
45+
response = self.client.companies.all(count=2, offset=2)
46+
self.assertEqual(200, response.code)
4747

48-
def test_retrieve_company(self):
49-
response = self.client.companies.create(self.test_company)
50-
body = response.body
48+
def test_retrieve_company(self):
49+
response = self.client.companies.create(self.test_company)
50+
body = response.body
5151

52-
response = self.client.companies.retrieve(body['id'])
53-
body = response.body
52+
response = self.client.companies.retrieve(body['id'])
53+
body = response.body
5454

55-
self.assertEqual(200, response.code)
56-
self.assertEqual(self.test_company['entity_name'], body['entity_name'])
55+
self.assertEqual(200, response.code)
56+
self.assertEqual(self.test_company['entity_name'], body['entity_name'])
5757

58-
def test_create_company(self):
59-
response = self.client.companies.create(self.test_company)
60-
self.assertEqual(201, response.code)
58+
def test_create_company(self):
59+
response = self.client.companies.create(self.test_company)
60+
self.assertEqual(201, response.code)
6161

6262
if __name__ == '__main__':
63-
unittest.main()
63+
unittest.main()
6464

test/people.py

Lines changed: 96 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
11
if __name__ == '__main__' and __package__ is None:
2-
from os import sys, path
3-
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
2+
from os import sys, path
3+
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
44
import blockscore
55
import unittest
66
import os, sys
77

88
class TestBlockscore(unittest.TestCase):
99

10-
def setUp(self):
11-
try:
12-
self.client = blockscore.Client({'api_key': os.environ['BLOCKSCORE_API']})
13-
except KeyError:
14-
sys.stderr.write("To run tests, you must have a BLOCKSCORE_API environment variable with a test api key\n")
15-
sys.exit(2)
16-
17-
self.test_identity = {
18-
"name_first": "John",
19-
"name_middle": "Pearce",
20-
"name_last": "Doe",
21-
"birth_day": "23",
22-
"birth_month": "8",
23-
"birth_year": "1980",
24-
"document_type": "ssn",
25-
"document_value": "0000",
26-
"address_street1": "1 Infinite Loop",
27-
"address_street2": "Apt 6",
28-
"address_city": "Cupertino",
29-
"address_subdivision": "CA",
30-
"address_postal_code": "95014",
31-
"address_country_code": "US",
32-
}
33-
def test_create_person(self):
34-
response = self.client.people.create(self.test_identity)
35-
self.assertEqual(response.body['name_first'], self.test_identity['name_first'])
36-
self.assertEqual(response.body['name_last'], self.test_identity['name_last'])
37-
38-
def test_retrieve_person(self):
39-
verif = self.client.people.create(self.test_identity)
40-
verif_id = verif.body['id']
41-
verif2 = self.client.people.retrieve(verif_id)
42-
self.assertEqual(verif.body, verif2.body)
43-
44-
def test_list_people(self):
45-
self.client.people.create(self.test_identity)
46-
self.client.people.create(self.test_identity)
47-
self.client.people.create(self.test_identity)
48-
verif_list = self.client.people.all(count=3)
49-
verif_list = verif_list.body
50-
self.assertTrue(len(verif_list) >= 3)
51-
verif_list2 = self.client.people.all(count=3,offset=3)
52-
verif_list2 = verif_list2.body
53-
self.assertNotEqual(verif_list, verif_list2)
54-
55-
56-
57-
def test_create_questions(self):
58-
verif = self.client.people.create(self.test_identity)
59-
verif = verif.body
60-
verif_id = verif['id']
61-
qset = self.client.question_sets.create(verif_id)
62-
qset = qset.body
63-
self.assertEqual(qset['person_id'],verif_id)
64-
65-
def test_score_questions(self):
66-
verif = self.client.people.create(self.test_identity)
67-
verif = verif.body
68-
verif_id = verif['id']
69-
qset = self.client.question_sets.create(verif_id)
70-
qset = qset.body
71-
qset_id = qset['id']
72-
score = self.client.question_sets.score(qset_id, [
73-
{'question_id':1, 'answer_id':1},
74-
{'question_id':2, 'answer_id':1},
75-
{'question_id':3, 'answer_id':1},
76-
{'question_id':4, 'answer_id':1},
77-
{'question_id':5, 'answer_id':1}
78-
])
79-
score = score.body
80-
self.assertEqual(score['id'],qset_id)
81-
self.assertIsInstance(score['score'],float)
82-
83-
84-
85-
# make sure the shuffled sequence does not lose any elements
86-
# random.shuffle(self.seq)
87-
# self.seq.sort()
88-
# self.assertEqual(self.seq, range(10))
89-
# self.assertEqual(1,1)
90-
91-
# should raise an exception for an immutable sequence
92-
# self.assertRaises(TypeError, random.shuffle, (1,2,3))
93-
94-
# def test_choice(self):
95-
# element = random.choice(self.seq)
96-
# self.assertTrue(element in self.seq)
97-
98-
# def test_sample(self):
99-
# with self.assertRaises(ValueError):
100-
# random.sample(self.seq, 20)
101-
# for element in random.sample(self.seq, 5):
102-
# self.assertTrue(element in self.seq)
10+
def setUp(self):
11+
try:
12+
self.client = blockscore.Client({'api_key': os.environ['BLOCKSCORE_API']})
13+
except KeyError:
14+
sys.stderr.write("To run tests, you must have a BLOCKSCORE_API environment variable with a test api key\n")
15+
sys.exit(2)
16+
17+
self.test_identity = {
18+
"name_first": "John",
19+
"name_middle": "Pearce",
20+
"name_last": "Doe",
21+
"birth_day": "23",
22+
"birth_month": "8",
23+
"birth_year": "1980",
24+
"document_type": "ssn",
25+
"document_value": "0000",
26+
"address_street1": "1 Infinite Loop",
27+
"address_street2": "Apt 6",
28+
"address_city": "Cupertino",
29+
"address_subdivision": "CA",
30+
"address_postal_code": "95014",
31+
"address_country_code": "US",
32+
}
33+
def test_create_person(self):
34+
response = self.client.people.create(self.test_identity)
35+
self.assertEqual(response.body['name_first'], self.test_identity['name_first'])
36+
self.assertEqual(response.body['name_last'], self.test_identity['name_last'])
37+
38+
def test_retrieve_person(self):
39+
verif = self.client.people.create(self.test_identity)
40+
verif_id = verif.body['id']
41+
verif2 = self.client.people.retrieve(verif_id)
42+
self.assertEqual(verif.body, verif2.body)
43+
44+
def test_list_people(self):
45+
self.client.people.create(self.test_identity)
46+
self.client.people.create(self.test_identity)
47+
self.client.people.create(self.test_identity)
48+
verif_list = self.client.people.all(count=3)
49+
verif_list = verif_list.body
50+
self.assertTrue(len(verif_list) >= 3)
51+
verif_list2 = self.client.people.all(count=3,offset=3)
52+
verif_list2 = verif_list2.body
53+
self.assertNotEqual(verif_list, verif_list2)
54+
55+
56+
57+
def test_create_questions(self):
58+
verif = self.client.people.create(self.test_identity)
59+
verif = verif.body
60+
verif_id = verif['id']
61+
qset = self.client.question_sets.create(verif_id)
62+
qset = qset.body
63+
self.assertEqual(qset['person_id'],verif_id)
64+
65+
def test_score_questions(self):
66+
verif = self.client.people.create(self.test_identity)
67+
verif = verif.body
68+
verif_id = verif['id']
69+
qset = self.client.question_sets.create(verif_id)
70+
qset = qset.body
71+
qset_id = qset['id']
72+
score = self.client.question_sets.score(qset_id, [
73+
{'question_id':1, 'answer_id':1},
74+
{'question_id':2, 'answer_id':1},
75+
{'question_id':3, 'answer_id':1},
76+
{'question_id':4, 'answer_id':1},
77+
{'question_id':5, 'answer_id':1}
78+
])
79+
score = score.body
80+
self.assertEqual(score['id'],qset_id)
81+
self.assertIsInstance(score['score'],float)
82+
83+
84+
85+
# make sure the shuffled sequence does not lose any elements
86+
# random.shuffle(self.seq)
87+
# self.seq.sort()
88+
# self.assertEqual(self.seq, range(10))
89+
# self.assertEqual(1,1)
90+
91+
# should raise an exception for an immutable sequence
92+
# self.assertRaises(TypeError, random.shuffle, (1,2,3))
93+
94+
# def test_choice(self):
95+
# element = random.choice(self.seq)
96+
# self.assertTrue(element in self.seq)
97+
98+
# def test_sample(self):
99+
# with self.assertRaises(ValueError):
100+
# random.sample(self.seq, 20)
101+
# for element in random.sample(self.seq, 5):
102+
# self.assertTrue(element in self.seq)
103103

104104
if __name__ == '__main__':
105-
unittest.main()
105+
unittest.main()
106106

0 commit comments

Comments
 (0)