def test2(self): self.assertEqual(ruc.calculateDV("61302-14-123411"), "22") self.assertEqual(ruc.calculateDV("1102-85-117211"), "95") self.assertEqual(ruc.calculateDV("2486589-1-816994"), "62") self.assertEqual(ruc.calculateDV("1830234-1-710357"), "82") self.assertEqual(ruc.calculateDV("41369-85-283456"), "73")
def test2(self): self.assertEqual(ruc.calculateDV('61302-14-123411'), '22') self.assertEqual(ruc.calculateDV('1102-85-117211'), '95') self.assertEqual(ruc.calculateDV('2486589-1-816994'), '62') self.assertEqual(ruc.calculateDV('1830234-1-710357'), '82') self.assertEqual(ruc.calculateDV('41369-85-283456'), '73')
def test2(self): self.assertEqual(ruc.calculateDV('61302-14-123411'),'22') self.assertEqual(ruc.calculateDV('1102-85-117211'),'95') self.assertEqual(ruc.calculateDV('2486589-1-816994'),'62') self.assertEqual(ruc.calculateDV('1830234-1-710357'),'82') self.assertEqual(ruc.calculateDV('41369-85-283456'),'73')
def check_vat_pa(self, vat): vat_split_dv = vat.split('DV') vat = vat_split_dv[0] ruc_vat.calculateDV(vat) if self.__check_vat_pa_re1.match(vat) or self.__check_vat_pa_re2.\ match(vat) or self.__check_vat_pa_re3.match(vat) or self.\ __check_vat_pa_re4.match(vat) or self.__check_vat_pa_re5.\ match(vat): if len(vat_split_dv) == 2: return ruc_vat.calculateDV(vat) == vat_split_dv[-1] return True return False
def test_I(self): "Formato para Cédulas (Personas Naturales)" # Panam self.assertEqual(ruc.calculateDV("8-442-445"), "08") self.assertEqual(ruc.calculateDV("PE-10-442"), "50") self.assertEqual(ruc.calculateDV("N-45-832"), "58") self.assertEqual(ruc.calculateDV("E-12-342"), "10") self.assertEqual(ruc.calculateDV("1AV-432-658"), "96") self.assertEqual(ruc.calculateDV("4PI-234-123"), "96")
def test_I(self): "Formato para Cédulas (Personas Naturales)" # Panam self.assertEqual(ruc.calculateDV('8-442-445'), '08') self.assertEqual(ruc.calculateDV('PE-10-442'), '50') self.assertEqual(ruc.calculateDV('N-45-832'), '58') self.assertEqual(ruc.calculateDV('E-12-342'), '10') self.assertEqual(ruc.calculateDV('1AV-432-658'), '96') self.assertEqual(ruc.calculateDV('4PI-234-123'), '96')
def test_I(self): "Formato para Cédulas (Personas Naturales)" # Panam self.assertEqual(ruc.calculateDV('8-442-445'), '08') self.assertEqual(ruc.calculateDV('PE-10-442'),'50') self.assertEqual(ruc.calculateDV('N-45-832'),'58') self.assertEqual(ruc.calculateDV('E-12-342'),'10') self.assertEqual(ruc.calculateDV('1-AV-432-658'),'31') self.assertEqual(ruc.calculateDV('4-PI-234-123'),'31')
def test_IV(self): "Formato para Jurídico NT" self.assertEqual(ruc.calculateDV(""), "") self.assertEqual(ruc.calculateDV(""), "")
def test_errors(self): self.assertEqual(ruc.calculateDV(''), '') self.assertEqual(ruc.calculateDV('E'), '')
def test_IV(self): "Formato para Jurídico NT" self.assertEqual(ruc.calculateDV(''), '') self.assertEqual(ruc.calculateDV(''), '')
def test_III(self): "Formato para RUC (Persona Jurídica)" self.assertEqual(ruc.calculateDV('11947-1027-0229562'), '71') self.assertEqual(ruc.calculateDV('11947-1-0229562'), '42')
def test_II(self): "Formato para Pasaportes (Persona Natural Extranjera)" self.assertEqual(ruc.calculateDV('PAS1311723564'), '')
def test3(self): self.assertEqual(ruc.calculateDV('64296-75-357434'), '00') self.assertEqual(ruc.calculateDV('203141-1-17214'), '60') self.assertEqual(ruc.calculateDV('1075137-1-553125'), '18')
def test_errors(self): self.assertEqual(ruc.calculateDV(""), "") self.assertEqual(ruc.calculateDV("E"), "")
def test3(self): self.assertEqual(ruc.calculateDV('64296-75-357434'),'00') self.assertEqual(ruc.calculateDV('203141-1-17214'),'60') self.assertEqual(ruc.calculateDV('1075137-1-553125'),'18')
def test_III(self): "Formato para RUC (Persona Jurídica)" self.assertEqual(ruc.calculateDV("11947-1027-0229562"), "71") self.assertEqual(ruc.calculateDV("11947-1-0229562"), "42")
def test_II(self): "Formato para Pasaportes (Persona Natural Extranjera)" self.assertEqual(ruc.calculateDV("PAS1311723564"), "")
def test3(self): self.assertEqual(ruc.calculateDV("64296-75-357434"), "00") self.assertEqual(ruc.calculateDV("203141-1-17214"), "60") self.assertEqual(ruc.calculateDV("1075137-1-553125"), "18")
def test_III(self): "Formato para RUC (Persona Jurídica)" self.assertEqual(ruc.calculateDV('11947-1027-0229562'),'71') self.assertEqual(ruc.calculateDV('11947-1-0229562'),'42')
def test_errors(self): self.assertEqual(ruc.calculateDV(''),'') self.assertEqual(ruc.calculateDV('E'),'')