~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
        """