Ticket #11 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

Patch — Unit test suite for TurboMail.

Reported by: fs Owned by: amcgregor
Priority: high Milestone: 2.1
Component: tests Version: 2.0.4
Keywords: patch Cc:

Description

Currently there are no unit tests for TurboMail. Attached to this ticket you find a basic skeleton which consists mainly of a LGPLed smtp mailsink and a first, very simple test case to demonstrate the usage.

Attachments

turbomail_tests.tar.gz (3.7 kB) - added by fs 1 year ago.
test suite skeleton
mailsink.patch (0.8 kB) - added by amcgregor 1 year ago.
Received patch from fs via TurboGears mailing list.

Change History

Changed 1 year ago by fs

test suite skeleton

Changed 1 year ago by fs

In the mean time, I rewrote the mail sink class a bit so that it uses Python's Queue internally which simplifies the code somewhat. I will submit the new version if my skeleton test suite got accepted so that my other patches will still apply as I changed the interface slightly (more convenience).

Changed 1 year ago by amcgregor

  • version set to 2.0.4
  • milestone set to 2.0.5

Attempting to apply this test suite to the 2.0.5 branch, your SMTPMailsink results in the following traceback:

running test
running egg_info
writing requirements to TurboMail.egg-info/requires.txt
writing TurboMail.egg-info/PKG-INFO
writing top-level names to TurboMail.egg-info/top_level.txt
writing dependency_links to TurboMail.egg-info/dependency_links.txt
writing entry points to TurboMail.egg-info/entry_points.txt
writing manifest file 'TurboMail.egg-info/SOURCES.txt'
running build_ext
/Library/Python/2.5/site-packages/nose-0.10.0-py2.5.egg/nose/plugins/manager.py:372: RuntimeWarning: Exclude plugin <nose.plugins.cover.Coverage object at 0x21000f0>: implements report
  RuntimeWarning)
/Library/Python/2.5/site-packages/nose-0.10.0-py2.5.egg/nose/plugins/manager.py:372: RuntimeWarning: Exclude plugin <nose.plugins.isolate.IsolationPlugin object at 0x21001d0>: implements prepareTestLoader
  RuntimeWarning)
/Library/Python/2.5/site-packages/nose-0.10.0-py2.5.egg/nose/plugins/manager.py:372: RuntimeWarning: Exclude plugin <nose.plugins.prof.Profile object at 0x2100210>: implements report
  RuntimeWarning)
/Library/Python/2.5/site-packages/nose-0.10.0-py2.5.egg/nose/plugins/manager.py:372: RuntimeWarning: Exclude plugin <nose.plugins.testid.TestId object at 0x2100290>: implements setOutputStream
  RuntimeWarning)
Test that sending a simple mail with turbomail.Message works. ... Exception in thread Thread-1:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/threading.py", line 460, in __bootstrap
    self.run()
  File "/Users/amcgregor/Public/TurboMail-2.0.5/tests/lib/smtp_mailsink.py", line 119, in run
    asyncore.loop(timeout=0.1)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/asyncore.py", line 191, in loop
    poll_fun(timeout, map)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/asyncore.py", line 121, in poll
    r, w, e = select.select(r, w, e, timeout)
error: (9, 'Bad file descriptor')

ok

----------------------------------------------------------------------
Ran 1 test in 0.140s

OK

Please see r25 to see how I slightly modified your tests to just start the TurboMail module, vs. the entire TurboGears system. (The error is identical either way.)

Changed 1 year ago by amcgregor

  • status changed from new to assigned

Changed 1 year ago by amcgregor

  • type changed from defect to enhancement

Changed 1 year ago by amcgregor

  • priority changed from normal to high
  • summary changed from Unit test suite for TurboMail to Unit test suite for TurboMail.

I believe the completion of this ticket will signal the release of TurboMail 2.0.5.

Changed 1 year ago by amcgregor

  • summary changed from Unit test suite for TurboMail. to Unit test suite for TurboMail. — Patch

Changed 1 year ago by amcgregor

  • keywords patch added

Changed 1 year ago by amcgregor

  • summary changed from Unit test suite for TurboMail. — Patch to Patch — Unit test suite for TurboMail.

Changed 1 year ago by amcgregor

Received patch from fs via TurboGears mailing list.

Changed 1 year ago by amcgregor

Applied patch as of r53. Unit tests succeed. I think we're go for launch of 2.1.

Changed 1 year ago by amcgregor

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.