~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-12-07 14:49:51 UTC
  • mto: (6213.1.27 feature-flags)
  • mto: This revision was merged to the branch mainline in revision 6353.
  • Revision ID: jelmer@samba.org-20111207144951-s6rl2er769aqtj1l
Fix remaining tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
        # is the right format object found for a working tree?
173
173
        branch = self.make_branch('branch')
174
174
        self.assertRaises(errors.NoWorkingTree,
175
 
            workingtree.WorkingTreeFormat.find_format_string, branch.bzrdir)
 
175
            workingtree.WorkingTreeFormatMetaDir.find_format_string, branch.bzrdir)
176
176
        transport = branch.bzrdir.get_workingtree_transport(None)
177
177
        transport.mkdir('.')
178
178
        transport.put_bytes("format", "some format name")
179
179
        # The format does not have to be known by Bazaar,
180
180
        # find_format_string just retrieves the name
181
181
        self.assertEquals("some format name",
182
 
            workingtree.WorkingTreeFormat.find_format_string(branch.bzrdir))
 
182
            workingtree.WorkingTreeFormatMetaDir.find_format_string(branch.bzrdir))
183
183
 
184
184
    def test_find_format(self):
185
185
        # is the right format object found for a working tree?
191
191
            dir.create_branch()
192
192
            format.initialize(dir)
193
193
            t = transport.get_transport(url)
194
 
            found_format = workingtree.WorkingTreeFormat.find_format(dir)
 
194
            found_format = workingtree.WorkingTreeFormatMetaDir.find_format(dir)
195
195
            self.assertIsInstance(found_format, format.__class__)
196
196
        check_format(workingtree_3.WorkingTreeFormat3(), "bar")
197
197
 
198
198
    def test_find_format_no_tree(self):
199
199
        dir = bzrdir.BzrDirMetaFormat1().initialize('.')
200
200
        self.assertRaises(errors.NoWorkingTree,
201
 
                          workingtree.WorkingTreeFormat.find_format,
 
201
                          workingtree.WorkingTreeFormatMetaDir.find_format,
202
202
                          dir)
203
203
 
204
204
    def test_find_format_unknown_format(self):
207
207
        dir.create_branch()
208
208
        SampleTreeFormat().initialize(dir)
209
209
        self.assertRaises(errors.UnknownFormatError,
210
 
                          workingtree.WorkingTreeFormat.find_format,
 
210
                          workingtree.WorkingTreeFormatMetaDir.find_format,
211
211
                          dir)
212
212
 
213
213
    def test_register_unregister_format(self):