Rev 204: Merged TestCaseWithQueue changes. in http://bzr.daniel-watkins.co.uk/pqm/abstract-patch

Daniel Watkins daniel at daniel-watkins.co.uk
Tue Jul 22 18:17:03 BST 2008


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

------------------------------------------------------------
revno: 204
revision-id: daniel at daniel-watkins.co.uk-20080722171533-4i9swhj7tkadfz2n
parent: daniel at daniel-watkins.co.uk-20080720154125-l9swnh5sjv2taakp
parent: daniel at daniel-watkins.co.uk-20080722171149-aut0g1391q5zdpjv
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: abstract-patch
timestamp: Tue 2008-07-22 18:15:33 +0100
message:
  Merged TestCaseWithQueue changes.
modified:
  pqm/tests/__init__.py          i_74708178-eda5-4993-8549-5eddd090ce8e
  pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
    ------------------------------------------------------------
    revno: 176.1.12
    revision-id: daniel at daniel-watkins.co.uk-20080722171149-aut0g1391q5zdpjv
    parent: daniel at daniel-watkins.co.uk-20080722170203-rr1mr5tlq1vxm9x6
    committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
    branch nick: TestCaseWithQueue
    timestamp: Tue 2008-07-22 18:11:49 +0100
    message:
      Fixed failing tests.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
    ------------------------------------------------------------
    revno: 176.1.11
    revision-id: daniel at daniel-watkins.co.uk-20080722170203-rr1mr5tlq1vxm9x6
    parent: daniel at daniel-watkins.co.uk-20080717104404-m2mkd8o1luidl0s0
    committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
    branch nick: TestCaseWithQueue
    timestamp: Tue 2008-07-22 18:02:03 +0100
    message:
      Converted TestCaseWithQueue to subclass bzrlib.tests.TestCaseWithTransport.
    modified:
      pqm/tests/__init__.py          i_74708178-eda5-4993-8549-5eddd090ce8e
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
-------------- next part --------------
=== modified file 'pqm/tests/__init__.py'
--- a/pqm/tests/__init__.py	2008-07-20 15:13:21 +0000
+++ b/pqm/tests/__init__.py	2008-07-22 17:15:33 +0000
@@ -3,7 +3,6 @@
 from textwrap import dedent
 
 from bzrlib.tests import TestCaseWithTransport
-from twisted.trial import unittest
 
 
 sample_message = dedent("""\

=== modified file 'pqm/tests/test_pqm.py'
--- a/pqm/tests/test_pqm.py	2008-07-20 15:41:25 +0000
+++ b/pqm/tests/test_pqm.py	2008-07-22 17:15:33 +0000
@@ -119,18 +119,12 @@
 
     def getScript(self, queue, content):
         """Get a script for testing with."""
-        scriptname = 'foo.script'
-        scriptFile = open(scriptname, "w")
-        scriptFile.write(content)
-        scriptFile.close()
-        def cleanupScript():
-            os.unlink(scriptname)
-        self.addCleanup(cleanupScript)
+        self.build_tree_contents([('foo.script', content)])
         pqm.pqm_subdir = os.path.abspath('queue/pqm')
         configp = ConfigParser()
         configp.read([queue.configFileName])
         handler = pqm.BranchSpecOptionHandler(configp)
-        return pqm.Script(scriptname, logging, False, 54, handler, configp)
+        return pqm.Script('foo.script', logging, False, 54, handler, configp)
 
     def testFields(self):
         queue = self.getQueue()



More information about the bazaar-commits mailing list