Rev 198: Nearer to working tests. in http://bzr.daniel-watkins.co.uk/pqm/abstract-patch

Daniel Watkins daniel at daniel-watkins.co.uk
Sun Jul 20 15:38:11 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/abstract-patch

------------------------------------------------------------
revno: 198
revision-id: daniel at daniel-watkins.co.uk-20080720143643-hsglti92y3i1p68z
parent: daniel at daniel-watkins.co.uk-20080720135622-0g07e2i4hpas5m89
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: abstract-patch
timestamp: Sun 2008-07-20 15:36:43 +0100
message:
  Nearer to working tests.
-------------- next part --------------
=== modified file 'pqm/tests/__init__.py'
--- a/pqm/tests/__init__.py	2008-07-17 10:44:04 +0000
+++ b/pqm/tests/__init__.py	2008-07-20 14:36:43 +0000
@@ -2,6 +2,7 @@
 import shutil
 from textwrap import dedent
 
+from bzrlib.tests import TestCaseWithTransport
 from twisted.trial import unittest
 
 
@@ -77,7 +78,7 @@
         shutil.rmtree(self.queuedir, ignore_errors=True)
 
 
-class TestCaseWithQueue(unittest.TestCase):
+class TestCaseWithQueue(TestCaseWithTransport):
 
     def getQueue(self, processing=True, empty=False):
         queue = QueueSetup(processing, empty)

=== modified file 'pqm/tests/test_pqm.py'
--- a/pqm/tests/test_pqm.py	2008-07-20 13:56:22 +0000
+++ b/pqm/tests/test_pqm.py	2008-07-20 14:36:43 +0000
@@ -344,12 +344,16 @@
         self.assertTrue(script.debug)
 
 
-class TestPatchCommand(TestCaseWithTransport):
+class TestPatchCommand(TestCaseWithQueue):
 
     def test_patch_command_applies_valid_patch(self):
+        tree = self.make_branch_and_tree('foo')
+        self.getQueue(empty=True)
+        self.build_tree(['bar/'])
+        pqm.workdir = 'bar'
         configp = ConfigParser()
-        pqm.pqm_subdir = os.path.abspath('.') # ewww
-        handler = pqm.BranchSpecOptionHandler(configp)
+        configp.add_section('foo')
+        handler = pqm.BranchSpecOptionHandler(configp, queuedir='queue')
         script = MockScript()
         command = PatchCommand(script, handler, configp, [], 'foo')
         command.run()



More information about the bazaar-commits mailing list