34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
import pytest
|
|
from app.services.dni_parser_service import DniParserService
|
|
|
|
|
|
def test_parser_dni_formato_2012():
|
|
raw = '00680051210"TELLO"CARLOS FACUNDO"M"34247025"B"09/02/1989"13/10/2021'
|
|
res = DniParserService.parsear(raw)
|
|
assert res["documento"] == "34247025"
|
|
assert res["apellido"] == "TELLO"
|
|
assert res["nombre"] == "CARLOS FACUNDO"
|
|
assert res["sexo"] == "M"
|
|
|
|
|
|
def test_parser_dni_formato_mi_argentina_con_arrobas():
|
|
raw = '00305336518@CIRILLI@GEORGINA SUSANA@2@28988082@A@23/08/1981@13/10/2014'
|
|
res = DniParserService.parsear(raw)
|
|
assert res["documento"] == "28988082"
|
|
assert res["apellido"] == "CIRILLI"
|
|
assert res["nombre"] == "GEORGINA SUSANA"
|
|
assert res["sexo"] == "F"
|
|
|
|
|
|
def test_parser_dni_formato_2009():
|
|
raw = '"34247025"A"1"TELLO"CARLOS FACUNDO"M"'
|
|
res = DniParserService.parsear(raw)
|
|
assert res["documento"] == "34247025"
|
|
assert res["apellido"] == "TELLO"
|
|
assert res["nombre"] == "CARLOS FACUNDO"
|
|
|
|
|
|
def test_parser_dni_numero_manual():
|
|
res = DniParserService.parsear("34247025")
|
|
assert res["documento"] == "34247025"
|