Skip to content

Instantly share code, notes, and snippets.

@khanbhai89
Created February 21, 2021 05:41
Show Gist options
  • Save khanbhai89/8c004b27ec65bdff848d092c1c041c2c to your computer and use it in GitHub Desktop.
Save khanbhai89/8c004b27ec65bdff848d092c1c041c2c to your computer and use it in GitHub Desktop.
This is custom library file for the Medium Article.
import random
import string
__version__ = '1.0.0'
class CustomLib(object):
ROBOT_LIBRARY_VERSION = __version__
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
def get_random_name(self, email_length):
letters = string.ascii_lowercase[:12]
return ''.join(random.choice(letters) for i in range(email_length))
def generate_random_emails(self, length):
domains = ["hotmail.com", "gmail.com", "aol.com",
"mail.com", "mail.kz", "yahoo.com"]
return [self.get_random_name(length)
+ '@'
+ random.choice(domains)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment