/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-10-23 17:59:52 UTC
  • mfrom: (3788.1.5 msvc_python24)
  • Revision ID: pqm@pqm.ubuntu.com-20081023175952-0gr8np56nf6ab5yn
(jam) Allow extensions to compile for python2.4 and using msvc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
# Authors:  Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
from cStringIO import StringIO
19
19
import os
104
104
class SampleTreeFormat(workingtree.WorkingTreeFormat):
105
105
    """A sample format
106
106
 
107
 
    this format is initializable, unsupported to aid in testing the
 
107
    this format is initializable, unsupported to aid in testing the 
108
108
    open and open_downlevel routines.
109
109
    """
110
110
 
142
142
            found_format = workingtree.WorkingTreeFormat.find_format(dir)
143
143
            self.failUnless(isinstance(found_format, format.__class__))
144
144
        check_format(workingtree.WorkingTreeFormat3(), "bar")
145
 
 
 
145
        
146
146
    def test_find_format_no_tree(self):
147
147
        dir = bzrdir.BzrDirMetaFormat1().initialize('.')
148
148
        self.assertRaises(errors.NoWorkingTree,
193
193
        t = control.get_workingtree_transport(None)
194
194
        self.assertEqualDiff('Bazaar-NG Working Tree format 3',
195
195
                             t.get('format').read())
196
 
        self.assertEqualDiff(t.get('inventory').read(),
 
196
        self.assertEqualDiff(t.get('inventory').read(), 
197
197
                              '<inventory format="5">\n'
198
198
                              '</inventory>\n',
199
199
                             )
202
202
        self.assertFalse(t.has('inventory.basis'))
203
203
        # no last-revision file means 'None' or 'NULLREVISION'
204
204
        self.assertFalse(t.has('last-revision'))
205
 
        # TODO RBC 20060210 do a commit, check the inventory.basis is created
 
205
        # TODO RBC 20060210 do a commit, check the inventory.basis is created 
206
206
        # correctly and last-revision file becomes present.
207
207
 
208
208
    def test_uses_lockdir(self):
209
209
        """WorkingTreeFormat3 uses its own LockDir:
210
 
 
 
210
            
211
211
            - lock is a directory
212
212
            - when the WorkingTree is locked, LockDir can see that
213
213
        """
286
286
    @needs_tree_write_lock
287
287
    def method_that_raises(self):
288
288
        """This method causes an exception when called with parameters.
289
 
 
 
289
        
290
290
        This allows the decorator code to be checked - it should still call
291
291
        unlock.
292
292
        """
303
303
        self.assertEqual(
304
304
            'method_with_tree_write_lock',
305
305
            tree.method_with_tree_write_lock.__name__)
306
 
        self.assertDocstring(
 
306
        self.assertEqual(
307
307
            "A lock_tree_write decorated method that returns its arguments.",
308
 
            tree.method_with_tree_write_lock)
 
308
            tree.method_with_tree_write_lock.__doc__)
309
309
        args = (1, 2, 3)
310
310
        kwargs = {'a':'b'}
311
311
        result = tree.method_with_tree_write_lock(1,2,3, a='b')