~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_foreign.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-06-02 15:39:06 UTC
  • mfrom: (4393.2.2 bzr.ls-fix)
  • Revision ID: pqm@pqm.ubuntu.com-20090602153906-1q6bresxw669b34i
(Mattias Eriksson) Clear the terminal before outputing 'bzr ls'
        results.

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