Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_credit_card_owner(self, p1, p2):
assert p1.credit_card_owner() == p2.credit_card_owner()
assert p1.credit_card_owner(gender=Gender.FEMALE) == \
p2.credit_card_owner(gender=Gender.FEMALE)
def test_surname(self, p1, p2):
assert p1.surname() == p2.surname()
assert p1.last_name(gender=Gender.MALE) == \
p2.last_name(gender=Gender.MALE)
def surname(self, gender: Optional[Gender] = None) -> str:
"""Generate a random surname.
:param gender: Gender's enum object.
:return: Surname.
:Example:
Smith.
"""
surnames = self._data['surnames']
# Surnames separated by gender.
if isinstance(surnames, dict):
key = self._validate_enum(gender, Gender)
surnames = surnames[key]
return self.random.choice(surnames)
def patronymic(self, gender: Gender = None) -> str:
"""Generate random patronymic name.
:param gender: Gender of person.
:return: Patronymic name.
:Example:
Алексеевна.
"""
gender = self._validate_enum(gender, Gender)
patronymics = self._data['patronymic'][gender]
return self.random.choice(patronymics)