Rev 180: Added pqm.tests.TestCaseWithQueue. in http://bzr.daniel-watkins.co.uk/pqm/empty-queue

Daniel Watkins daniel at daniel-watkins.co.uk
Thu Jul 10 17:26:19 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/empty-queue

------------------------------------------------------------
revno: 180
revision-id: daniel at daniel-watkins.co.uk-20080710162506-tpi33egh01pu79tg
parent: daniel at daniel-watkins.co.uk-20080710161953-ohx24ca1c88s9m0j
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: TestCaseWithQueue
timestamp: Thu 2008-07-10 17:25:06 +0100
message:
  Added pqm.tests.TestCaseWithQueue.
-------------- next part --------------
=== modified file 'pqm/tests/__init__.py'
--- a/pqm/tests/__init__.py	2008-07-10 16:19:53 +0000
+++ b/pqm/tests/__init__.py	2008-07-10 16:25:06 +0000
@@ -2,6 +2,8 @@
 import shutil
 from textwrap import dedent
 
+from twisted.trial import unittest
+
 
 sample_message = dedent("""\
     From: John.Citizen at example.com
@@ -73,3 +75,18 @@
     def tearDown(self):
         os.unlink(self.configFileName)
         shutil.rmtree(self.queuedir, ignore_errors=True)
+
+
+class TestCaseWithQueue(unittest.TestCase):
+
+    def setUp(self):
+        super(TestCaseWithQueue, self).setUp()
+
+    def tearDown(self):
+        super(TestCaseWithQueue, self).tearDown()
+
+    def getQueue(self, processing=True, empty=False):
+        queue = QueueSetup(processing, empty)
+        queue.setUp()
+        self.addCleanup(queue.tearDown)
+        return queue

=== modified file 'pqm/tests/test_pqm.py'
--- a/pqm/tests/test_pqm.py	2008-07-10 16:19:53 +0000
+++ b/pqm/tests/test_pqm.py	2008-07-10 16:25:06 +0000
@@ -4,9 +4,6 @@
 from StringIO import StringIO
 from textwrap import dedent
 
-import config_manager
-from twisted.trial import unittest
-
 from bzrlib.tests import TestCaseWithTransport
 import config_manager
 from twisted.trial import unittest



More information about the bazaar-commits mailing list