~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_commit.py

  • Committer: Florent Gallaire
  • Date: 2017-03-17 10:39:02 UTC
  • mto: This revision was merged to the branch mainline in revision 6622.
  • Revision ID: fgallaire@gmail.com-20170317103902-xsmafws9vn8rczx9
Fix for Windows and 32-bit platforms buggy gmtime().

Show diffs side-by-side

added added

removed removed

Lines of Context:
713
713
        self.assertEqual(
714
714
            'Sat 2009-10-10 08:00:00 +0100',
715
715
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
716
 
        
 
716
 
 
717
    def test_commit_time_negative_windows(self):
 
718
        tree = self.make_branch_and_tree('tree')
 
719
        self.build_tree(['tree/hello.txt'])
 
720
        tree.add('hello.txt')
 
721
        out, err = self.run_bzr("commit -m hello "
 
722
            "--commit-time='1969-10-10 00:00:00 +0000' tree/hello.txt")
 
723
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
724
        self.assertEqual(
 
725
            'Fri 1969-10-10 00:00:00 +0000',
 
726
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
 
727
 
 
728
    def test_commit_time_negative_32bit(self):
 
729
        tree = self.make_branch_and_tree('tree')
 
730
        self.build_tree(['tree/hello.txt'])
 
731
        tree.add('hello.txt')
 
732
        out, err = self.run_bzr("commit -m hello "
 
733
            "--commit-time='1900-01-01 00:00:00 +0000' tree/hello.txt")
 
734
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
735
        self.assertEqual(
 
736
            'Mon 1900-01-01 00:00:00 +0000',
 
737
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
 
738
 
 
739
    def test_commit_time_positive_32bit(self):
 
740
        tree = self.make_branch_and_tree('tree')
 
741
        self.build_tree(['tree/hello.txt'])
 
742
        tree.add('hello.txt')
 
743
        out, err = self.run_bzr("commit -m hello "
 
744
            "--commit-time='2039-01-01 00:00:00 +0000' tree/hello.txt")
 
745
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
 
746
        self.assertEqual(
 
747
            'Sat 2039-01-01 00:00:00 +0000',
 
748
            osutils.format_date(last_rev.timestamp, last_rev.timezone))
 
749
 
717
750
    def test_commit_time_bad_time(self):
718
751
        tree = self.make_branch_and_tree('tree')
719
752
        self.build_tree(['tree/hello.txt'])