the last file in the mailtools packageexample - lists the self-test code for the package this code is separate script filein order to allow for import search path manipulation--it emulates real clientwhich is assumed to have mailconfig py module in its own source directory (this module can vary per clientexample - pp \internet\email\mailtools\selftest py ""##############################################################################self-test when this file is run as program ##############################################################################""mailconfig normally comes from the client' source directory or sys pathfor testingget it from email directory one level up import sys sys path append('import mailconfig print('config:'mailconfig __file__get these from __init__ from mailtools import (mailfetcherconsolemailsendermailsenderauthconsolemailparserif not mailconfig smtpusersender mailsender(tracesize= elsesender mailsenderauthconsole(tracesize= sender sendmessage(from mailconfig myaddressto [mailconfig myaddress]subj 'testing mailtools package'extrahdrs [(' -mailer''mailtools')]bodytext 'here is my source code\ 'attaches ['selftest py']bodytextencoding='utf- 'attachesencodings=['latin- ']attaches=['monkeys jpg']to=' adddr list 'other tests to try inspect text headers verify base encoded test mime/unicode headers change mailconfig to test fetchlimit fetcher mailfetcherconsole(def status(*args)print(argshdrssizesloadedall fetcher downloadallheaders(statusfor numhdr in enumerate(hdrs[: ])print(hdrthe mailtools utility package