def test_jcb15(self, faker, num_samples): provider = CreditCardProvider(faker) for prefix in provider.prefix_jcb15: for _ in range(num_samples): number = provider._generate_number(prefix, 15) assert len(number) == 15 assert self.jcb_pattern.fullmatch(number)
def test_discover(self, faker, num_samples): provider = CreditCardProvider(faker) for prefix in provider.prefix_discover: for _ in range(num_samples): number = provider._generate_number(prefix, 16) assert len(number) == 16 assert self.discover_pattern.fullmatch(number)
def test_diners_club(self, faker, num_samples): provider = CreditCardProvider(faker) for prefix in provider.prefix_diners: for _ in range(num_samples): number = provider._generate_number(prefix, 14) assert len(number) == 14 assert self.diners_club_pattern.fullmatch(number)
def test_visa19(self, faker, num_samples): provider = CreditCardProvider(faker) for prefix in provider.prefix_visa: for _ in range(num_samples): number = provider._generate_number(prefix, 19) assert len(number) == 19 assert self.visa_pattern.fullmatch(number)