~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-19 18:02:26 UTC
  • mfrom: (1868 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1869.
  • Revision ID: john@arbash-meinel.com-20060719180226-ce7d12331fedbb70
[merge] bzr.dev 1868, cleanup NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
520
520
        basis = tree.basis_tree().inventory
521
521
        self.assertIs(None, basis.path2id('a'))
522
522
        self.assertFalse(basis.path2id('b') is None)
 
523
 
 
524
    def test_commit_saves_1ms_timestamp(self):
 
525
        """Passing in a timestamp is saved with 1ms resolution"""
 
526
        tree = self.make_branch_and_tree('.')
 
527
        self.build_tree(['a'])
 
528
        tree.add('a')
 
529
        tree.commit('added a', timestamp=1153248633.4186721, timezone=0,
 
530
                    rev_id='a1')
 
531
 
 
532
        rev = tree.branch.repository.get_revision('a1')
 
533
        self.assertEqual(1153248633.419, rev.timestamp)
 
534
 
 
535
    def test_commit_has_1ms_resolution(self):
 
536
        """Allowing commit to generate the timestamp also has 1ms resolution"""
 
537
        tree = self.make_branch_and_tree('.')
 
538
        self.build_tree(['a'])
 
539
        tree.add('a')
 
540
        tree.commit('added a', rev_id='a1')
 
541
 
 
542
        rev = tree.branch.repository.get_revision('a1')
 
543
        timestamp = rev.timestamp
 
544
        timestamp_1ms = round(timestamp, 3)
 
545
        self.assertEqual(timestamp_1ms, timestamp)