Compare commits
No commits in common. "eaf6aeeccc7a590c28127a5b0a0d92a33f1fd09e" and "0082ee2bad9bf66cac204667d91b2d27e6604ddd" have entirely different histories.
eaf6aeeccc
...
0082ee2bad
4 changed files with 0 additions and 151 deletions
43
test.py
43
test.py
|
@ -71,49 +71,6 @@ class TestValidation(tornado.testing.AsyncHTTPTestCase):
|
||||||
self.assertIn('valid', validation_result, "Key 'valid' expected in validation result")
|
self.assertIn('valid', validation_result, "Key 'valid' expected in validation result")
|
||||||
self.assertTrue(validation_result['valid'], "Validation result is expected to be valid==true")
|
self.assertTrue(validation_result['valid'], "Validation result is expected to be valid==true")
|
||||||
|
|
||||||
def test_invalid_iban(self):
|
|
||||||
entity_file = json.load(open('test_cases/invalid/invalid_iban.json','r'))
|
|
||||||
|
|
||||||
response = self.fetch('/v0/validate',
|
|
||||||
method='POST',
|
|
||||||
body=json.dumps(entity_file))
|
|
||||||
|
|
||||||
self.assertEqual(200, response.code, "Validation must always return 200")
|
|
||||||
|
|
||||||
validation_result = json.loads(response.body.decode())
|
|
||||||
|
|
||||||
self.assertIn('valid', validation_result, "Key 'valid' expected in validation result")
|
|
||||||
self.assertFalse(validation_result['valid'], "Validation result is expected to be valid==false")
|
|
||||||
|
|
||||||
def test_missing_id(self):
|
|
||||||
entity_file = json.load(open('test_cases/invalid/missing_id.json','r'))
|
|
||||||
|
|
||||||
response = self.fetch('/v0/validate',
|
|
||||||
method='POST',
|
|
||||||
body=json.dumps(entity_file))
|
|
||||||
|
|
||||||
self.assertEqual(200, response.code, "Validation must always return 200")
|
|
||||||
|
|
||||||
validation_result = json.loads(response.body.decode())
|
|
||||||
|
|
||||||
self.assertIn('valid', validation_result, "Key 'valid' expected in validation result")
|
|
||||||
self.assertFalse(validation_result['valid'], "Validation result is expected to be valid==false")
|
|
||||||
self.assertIn('id', validation_result['errors'])
|
|
||||||
|
|
||||||
def test_invalid_id(self):
|
|
||||||
entity_file = json.load(open('test_cases/invalid/invalid_id.json','r'))
|
|
||||||
|
|
||||||
response = self.fetch('/v0/validate',
|
|
||||||
method='POST',
|
|
||||||
body=json.dumps(entity_file))
|
|
||||||
|
|
||||||
self.assertEqual(200, response.code, "Validation must always return 200")
|
|
||||||
|
|
||||||
validation_result = json.loads(response.body.decode())
|
|
||||||
|
|
||||||
self.assertIn('valid', validation_result, "Key 'valid' expected in validation result")
|
|
||||||
self.assertFalse(validation_result['valid'], "Validation result is expected to be valid==false")
|
|
||||||
self.assertIn('id', validation_result['errors'])
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
"finanzdaten": {
|
|
||||||
"bic": "PBNKDEFFXXX",
|
|
||||||
"holder": "",
|
|
||||||
"iban": "DX89370400440532013000",
|
|
||||||
"issuance": "2012-01-01",
|
|
||||||
"reference": "0042",
|
|
||||||
"scan-sepa-mandate": ""
|
|
||||||
},
|
|
||||||
"mitgliederdaten": {
|
|
||||||
"bis": "",
|
|
||||||
"mitgliedsbeitrag": "30",
|
|
||||||
"scan-antrag": "",
|
|
||||||
"schliessberechtigung": "Ja",
|
|
||||||
"spendenbeitrag": "0",
|
|
||||||
"status": "V",
|
|
||||||
"von": "2012-01-01"
|
|
||||||
},
|
|
||||||
"stammdaten": {
|
|
||||||
"address_code": "39104",
|
|
||||||
"address_country": "DE",
|
|
||||||
"address_label": "Max Hackerberg\nLeibnizstr. 32\n39104 Magdeburg",
|
|
||||||
"address_locality": "Magdeburg",
|
|
||||||
"address_region": "",
|
|
||||||
"address_street": "Leibnizstr. 32",
|
|
||||||
"birth_date": "1970-01-01",
|
|
||||||
"birth_location": "Hackstadt",
|
|
||||||
"email": "max.hackerberg@netz39.de",
|
|
||||||
"fullname": "Max Hackerberg",
|
|
||||||
"nickname": "maxH",
|
|
||||||
"pgp-key": "",
|
|
||||||
"ssh-key": ""
|
|
||||||
},
|
|
||||||
"timestamp": "2020-03-25T23:58:11",
|
|
||||||
"id": "6af68"
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
"finanzdaten": {
|
|
||||||
"bic": "PBNKDEFFXXX",
|
|
||||||
"holder": "",
|
|
||||||
"iban": "DE89370400440532013000",
|
|
||||||
"issuance": "2012-01-01",
|
|
||||||
"reference": "0042",
|
|
||||||
"scan-sepa-mandate": ""
|
|
||||||
},
|
|
||||||
"mitgliederdaten": {
|
|
||||||
"bis": "",
|
|
||||||
"mitgliedsbeitrag": "30",
|
|
||||||
"scan-antrag": "",
|
|
||||||
"schliessberechtigung": "Ja",
|
|
||||||
"spendenbeitrag": "0",
|
|
||||||
"status": "V",
|
|
||||||
"von": "2012-01-01"
|
|
||||||
},
|
|
||||||
"stammdaten": {
|
|
||||||
"address_code": "39104",
|
|
||||||
"address_country": "DE",
|
|
||||||
"address_label": "Max Hackerberg\nLeibnizstr. 32\n39104 Magdeburg",
|
|
||||||
"address_locality": "Magdeburg",
|
|
||||||
"address_region": "",
|
|
||||||
"address_street": "Leibnizstr. 32",
|
|
||||||
"birth_date": "1970-01-01",
|
|
||||||
"birth_location": "Hackstadt",
|
|
||||||
"email": "max.hackerberg@netz39.de",
|
|
||||||
"fullname": "Max Hackerberg",
|
|
||||||
"nickname": "maxH",
|
|
||||||
"pgp-key": "",
|
|
||||||
"ssh-key": ""
|
|
||||||
},
|
|
||||||
"timestamp": "2020-03-25T23:58:11",
|
|
||||||
"id": "6ay68"
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
"finanzdaten": {
|
|
||||||
"bic": "PBNKDEFFXXX",
|
|
||||||
"holder": "",
|
|
||||||
"iban": "DE89370400440532013000",
|
|
||||||
"issuance": "2012-01-01",
|
|
||||||
"reference": "0042",
|
|
||||||
"scan-sepa-mandate": ""
|
|
||||||
},
|
|
||||||
"mitgliederdaten": {
|
|
||||||
"bis": "",
|
|
||||||
"mitgliedsbeitrag": "30",
|
|
||||||
"scan-antrag": "",
|
|
||||||
"schliessberechtigung": "Ja",
|
|
||||||
"spendenbeitrag": "0",
|
|
||||||
"status": "V",
|
|
||||||
"von": "2012-01-01"
|
|
||||||
},
|
|
||||||
"stammdaten": {
|
|
||||||
"address_code": "39104",
|
|
||||||
"address_country": "DE",
|
|
||||||
"address_label": "Max Hackerberg\nLeibnizstr. 32\n39104 Magdeburg",
|
|
||||||
"address_locality": "Magdeburg",
|
|
||||||
"address_region": "",
|
|
||||||
"address_street": "Leibnizstr. 32",
|
|
||||||
"birth_date": "1970-01-01",
|
|
||||||
"birth_location": "Hackstadt",
|
|
||||||
"email": "max.hackerberg@netz39.de",
|
|
||||||
"fullname": "Max Hackerberg",
|
|
||||||
"nickname": "maxH",
|
|
||||||
"pgp-key": "",
|
|
||||||
"ssh-key": ""
|
|
||||||
},
|
|
||||||
"timestamp": "2020-03-25T23:58:11",
|
|
||||||
"id": ""
|
|
||||||
}
|
|
Loading…
Reference in a new issue