~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_foreign.py

  • Committer: Jelmer Vernooij
  • Date: 2009-06-01 02:55:34 UTC
  • mto: This revision was merged to the branch mainline in revision 4394.
  • Revision ID: jelmer@samba.org-20090601025534-6by2tezdu22j7f89
Move showing of foreign revision info onto log, for better performance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
301
301
        self.assertEquals(mapp, rev.mapping)
302
302
 
303
303
 
304
 
class ShowForeignPropertiesTests(TestCase):
305
 
    """Tests for the show_foreign_properties() function."""
306
 
 
307
 
    def setUp(self):
308
 
        super(ShowForeignPropertiesTests, self).setUp()
309
 
        self.vcs = DummyForeignVcs()
310
 
        foreign.foreign_vcs_registry.register("dummy",
311
 
            self.vcs, "Dummy VCS")
312
 
 
313
 
    def tearDown(self):
314
 
        super(ShowForeignPropertiesTests, self).tearDown()
315
 
        foreign.foreign_vcs_registry.remove("dummy")
316
 
 
317
 
    def test_show_non_foreign(self):
318
 
        """Test use with a native (non-foreign) bzr revision."""
319
 
        self.assertEquals({}, foreign.show_foreign_properties(Revision("arevid")))
320
 
 
321
 
    def test_show_imported(self):
322
 
        rev = Revision("dummy-v1:my-foreign-revid")
323
 
        self.assertEquals({ "dummy ding": "my/foreign\\revid" },
324
 
                          foreign.show_foreign_properties(rev))
325
 
 
326
 
    def test_show_direct(self):
327
 
        rev = foreign.ForeignRevision(("some", "foreign", "revid"),
328
 
                                      DummyForeignVcsMapping(self.vcs),
329
 
                                      "roundtrip-revid")
330
 
        self.assertEquals({ "dummy ding": "some/foreign\\revid" },
331
 
                          foreign.show_foreign_properties(rev))
332
 
 
333
 
 
334
304
class WorkingTreeFileUpdateTests(TestCaseWithTransport):
335
305
    """Tests for update_workingtree_fileids()."""
336
306