could you use mock to test this by mocking out the appropriate parts of smtplib?