[Zope3-dev] Re: [Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/SmtpService/Views - __init__.py:1.1 configure.zcml:1.1

Jim Fulton jim@zope.com
Mon, 28 Oct 2002 09:28:35 -0500


Guido van Rossum wrote:
>>>Does it just use smtplib to send the mail?  Perhaps the right approach
>>>would be to replace smtplib with a stub that records the calls into
>>>the library so the result can be checked for sanity.  The replacement
>>>could be inserted during the setup and replaced in the teardown.
>>>
>>Right. This would require hacking sys.modules.
>>
> 
> Or changing the API slightly so that the SMTP class can be passed in
> rather than always importing it from smtplib.

Right. That's what Steve suggested. That seems pretty intrusive, but
OK. :)

Jim


-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org