~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-03 23:16:56 UTC
  • mto: This revision was merged to the branch mainline in revision 5819.
  • Revision ID: jelmer@samba.org-20110503231656-4sxm717yejm8cpuw
Add tariff test to make sure working tree isn't opened by 'bzr serve'
that simply accesses a branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
class TestWorkingTreeFormat(TestCaseWithTransport):
167
167
    """Tests for the WorkingTreeFormat facility."""
168
168
 
 
169
    def test_find_format_string(self):
 
170
        # is the right format object found for a working tree?
 
171
        branch = self.make_branch('branch')
 
172
        self.assertRaises(errors.NoWorkingTree,
 
173
            workingtree.WorkingTreeFormat.find_format_string, branch.bzrdir)
 
174
        transport = branch.bzrdir.get_workingtree_transport(None)
 
175
        transport.mkdir('.')
 
176
        transport.put_bytes("format", "some format name")
 
177
        # The format does not have to be known by Bazaar,
 
178
        # find_format_string just retrieves the name
 
179
        self.assertEquals("some format name",
 
180
            workingtree.WorkingTreeFormat.find_format_string(branch.bzrdir))
 
181
 
169
182
    def test_find_format(self):
170
183
        # is the right format object found for a working tree?
171
184
        # create a branch with a few known format objects.