def test_in(self): parser = aamva.AAMVA() data = parser._decodeBarcode(PDF417.indiana) self.assertEqual(data['document'], '07040602300001') self.assertEqual(data['IIN'], '636037') self.assertEqual(data['address'], '123 SAMPLE DRIVE') self.assertEqual(data['city'], 'INDIANAPOLIS') self.assertEqual(data['class'], 'X-1X-2') self.assertEqual(data['dob'], datetime.date(1989, 7, 4)) self.assertEqual(data['endorsements'], 'X-1XY') self.assertEqual(data['eyes'], 'HAZ') self.assertEqual(data['first'], 'HEIDIFIRSTNAMEUPTO40CHARACTERSXYWXYWXYWX') self.assertEqual(data['middle'], 'MIDDLENAMEUPTO40CHARACTERSXYWXYWXYWXYWXY') self.assertEqual(data['last'], 'SAMPLEFAMILYNAMEUPTO40CHARACTERSXYWXYWXY') self.assertIs(data['prefix'], None) self.assertEqual(data['hair'], 'BLN') self.assertEqual(data['height'], aamva.Height(64, format='USA')) self.assertEqual(data['expiry'], datetime.date(2010, 7, 4)) self.assertEqual(data['issued'], datetime.date(2006, 7, 4)) self.assertEqual(data['license_number'], '1234-56-7890') self.assertEqual(data['restrictions'], 'X-1X-2X-3X-4') self.assertEqual(data['sex'], 'F') self.assertEqual(data['state'], 'IN') self.assertEqual(data['suffix'], 'XYWXY') self.assertEqual(data['weight'], aamva.Weight(None, 120, 'USA')) pprint.pprint(data)
def test_ga(self): parser = aamva.AAMVA() data = parser._decodeBarcode(PDF417.ga) self.assertEqual(data['document'], '1234509876543210987654321') self.assertEqual(data['IIN'], '636055') self.assertEqual(data['address'], '123 MAIN STREET') self.assertEqual(data['city'], 'ANYTOWN') self.assertEqual(data['class'], 'C') self.assertEqual(data['dob'], datetime.date(1957, 7, 1)) self.assertEqual(data['endorsements'], 'NONE') self.assertEqual(data['eyes'], 'BLU') self.assertEqual(data['first'], 'JANICE') self.assertEqual(data['middle'], 'NONE') self.assertEqual(data['last'], 'SAMPLE') self.assertIs(data['prefix'], None) self.assertIs(data['hair'], None) self.assertEqual(data['height'], aamva.Height(64, format='USA')) self.assertEqual(data['expiry'], datetime.date(2017, 7, 1)) self.assertEqual(data['issued'], datetime.date(2012, 7, 1)) self.assertEqual(data['license_number'], '123456789') self.assertEqual(data['restrictions'], 'B') self.assertEqual(data['sex'], 'F') self.assertEqual(data['state'], 'GA') self.assertEqual(data['suffix'], 'NONE') self.assertEqual(data['weight'], aamva.Weight(None, weight=120, format='USA')) pprint.pprint(data)
def test_wa_edl(self): parser = aamva.AAMVA() data = parser._decodeBarcode(PDF417.wa_edl) self.assertEqual(data['document'], 'OREALDD521DSL1083014J1459') self.assertEqual(data['IIN'], '636045') self.assertEqual(data['address'], '2600 MARTIN WAY') self.assertEqual(data['city'], 'OLYMPIA') self.assertEqual(data['class'], 'NONE') self.assertEqual(data['dob'], datetime.date(1948, 3, 10)) self.assertEqual(data['endorsements'], 'NONE') self.assertEqual(data['eyes'], 'BLU') self.assertEqual(data['first'], 'DABE') self.assertEqual(data['middle'], 'DEE') self.assertEqual(data['last'], 'O REALTEST') self.assertIs(data['prefix'], None) self.assertIs(data['hair'], None) self.assertEqual(data['height'], aamva.Height(70, format='USA')) self.assertEqual(data['expiry'], datetime.date(2013, 3, 10)) self.assertEqual(data['issued'], datetime.date(2008, 10, 27)) self.assertEqual(data['license_number'], 'OREALDD521DS') self.assertEqual(data['restrictions'], 'NONE') self.assertEqual(data['sex'], 'M') self.assertEqual(data['state'], 'WA') self.assertEqual(data['suffix'], 'V') self.assertEqual(data['weight'], aamva.Weight(None, weight=175, format='USA')) pprint.pprint(data)
def test_va(self): parser = aamva.AAMVA() data = parser._decodeBarcode(PDF417.va) self.assertEqual(data['document'], '061234567') self.assertEqual(data['IIN'], '636000') self.assertEqual(data['address'], '17 FIRST STREET') self.assertEqual(data['city'], 'STAUNTON') self.assertEqual(data['class'], 'NONE') self.assertEqual(data['dob'], datetime.date(1958, 7, 15)) self.assertEqual(data['endorsements'], 'S') self.assertEqual(data['eyes'], 'BRO') self.assertEqual(data['first'], 'JUSTIN') self.assertEqual(data['middle'], 'WILLIAM') self.assertEqual(data['last'], 'MAURY') self.assertIs(data['prefix'], None) self.assertIs(data['hair'], None) self.assertEqual(data['height'], aamva.Height(75, format='USA')) self.assertEqual(data['expiry'], datetime.date(2017, 8, 14)) self.assertEqual(data['issued'], datetime.date(2009, 8, 14)) self.assertEqual(data['license_number'], 'T16700185') self.assertEqual(data['restrictions'], '158X9') self.assertEqual(data['sex'], 'M') self.assertEqual(data['state'], 'VA') self.assertIs(data['suffix'], None) self.assertIs(data['weight'], None) # VA does not encode weight pprint.pprint(data)
def test_wa(self): parser = aamva.AAMVA() data = parser._decodeBarcode(PDF417.wa) self.assertEqual(data['document'], 'ANASTPM320QDL1102574D1643') self.assertEqual(data['IIN'], '636045') self.assertEqual(data['address'], '2600 MARTIN WAY E') self.assertEqual(data['city'], 'OLYMPIA') self.assertEqual(data['class'], 'NONE') self.assertEqual(data['dob'], datetime.date(1968, 11, 4)) self.assertEqual(data['endorsements'], 'NONE') self.assertEqual(data['eyes'], 'GRN') self.assertEqual(data['first'], 'PRINCESS') self.assertEqual(data['middle'], 'MONACO') self.assertEqual(data['last'], 'ANASTASIA') self.assertIs(data['prefix'], None) self.assertIs(data['hair'], None) self.assertEqual(data['height'], aamva.Height(63, format='USA')) self.assertEqual(data['expiry'], datetime.date(2014, 11, 4)) self.assertEqual(data['issued'], datetime.date(2010, 9, 14)) self.assertEqual(data['license_number'], 'ANASTPM320QD') self.assertEqual(data['restrictions'], 'NONE') self.assertEqual(data['sex'], 'F') self.assertEqual(data['state'], 'WA') self.assertEqual(data['suffix'], '') self.assertEqual(data['weight'], aamva.Weight(None, weight=115, format='USA')) pprint.pprint(data)