~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

  • Committer: Jamie Wilkinson
  • Date: 2006-03-27 12:44:47 UTC
  • mto: This revision was merged to the branch mainline in revision 1874.
  • Revision ID: jaq@spacepants.org-20060327124447-96b90762e112e280
test that revision accessors act idempotently

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
        self.assertEqual({'B':['A'],
331
331
                          'A':[]},
332
332
                         source.get_revision_graph('B'))
 
333
 
 
334
class TestRevisionAttributes(TestCaseWithTransport):
 
335
    """Test that revision attributes are correct."""
 
336
 
 
337
    def test_revision_accessors(self):
 
338
        """Make sure the values that come out of a revision are the same as the ones that go in.
 
339
        """
 
340
        tree1 = self.make_branch_and_tree("br1")
 
341
 
 
342
        # create a revision
 
343
        tree1.commit(message="quux", allow_pointless=True, committer="jaq")
 
344
        assert len(tree1.branch.revision_history()) > 0
 
345
        rev_a = tree1.branch.repository.get_revision(tree1.branch.last_revision())
 
346
 
 
347
        tree2 = self.make_branch_and_tree("br2")
 
348
        tree2.commit(message=rev_a.message,
 
349
                     timestamp=rev_a.timestamp,
 
350
                     timezone=rev_a.timezone,
 
351
                     committer=rev_a.committer,
 
352
                     rev_id=rev_a.revision_id,
 
353
                     allow_pointless=True, # there's nothing in this commit
 
354
                     strict=True,
 
355
                     verbose=True)
 
356
        rev_b = tree2.branch.repository.get_revision(tree2.branch.last_revision())
 
357
        
 
358
        self.assertEqual(rev_a.message, rev_b.message)
 
359
        self.assertEqual(rev_a.timestamp, rev_b.timestamp)
 
360
        self.assertEqual(rev_a.timezone, rev_b.timezone)
 
361
        self.assertEqual(rev_a.committer, rev_b.committer)
 
362
        self.assertEqual(rev_a.revision_id, rev_b.revision_id)