~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_timestamp.py

  • Committer: Alexander Belchenko
  • Date: 2012-03-29 08:34:13 UTC
  • mto: (6015.44.14 2.4)
  • mto: This revision was merged to the branch mainline in revision 6513.
  • Revision ID: bialix@ukr.net-20120329083413-d4bqqdtfn2yrxp4f
change st_dev, st_ino, st_uid, st_gid from int members to properties.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        # offset of three minutes
59
59
        self.assertEqual((1173193459, +3 * 60),
60
60
            timestamp.parse_patch_date('2007-03-06 15:07:19 +0003'))
61
 
        # No space between time and offset
62
 
        self.assertEqual((1173193459, -5 * 3600),
63
 
            timestamp.parse_patch_date('2007-03-06 10:04:19-0500'))
64
 
        # Extra spacing
65
 
        self.assertEqual((1173193459, -5 * 3600),
66
 
            timestamp.parse_patch_date('2007-03-06     10:04:19     -0500'))
67
 
 
68
 
    def test_parse_patch_date_bad(self):
69
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
70
 
            'NOT A TIME')
71
 
        # Extra data at end
72
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
73
 
            '2007-03-06 10:04:19 -0500x')
74
 
        # Missing day
75
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
76
 
            '2007-03 10:04:19 -0500')
77
 
        # Missing seconds
78
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
79
 
            '2007-03-06 10:04 -0500')
80
 
        # Missing offset
81
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
82
 
            '2007-03-06 10:04:19')
83
 
        # Missing plus or minus in offset
84
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
85
 
            '2007-03-06 10:04:19 0500')
86
 
        # Invalid hour in offset
87
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
88
 
            '2007-03-06 10:04:19 +2400')
89
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
90
 
            '2007-03-06 10:04:19 -2400')
91
 
        # Invalid minute in offset
92
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
93
 
            '2007-03-06 10:04:19 -0560')
94
 
        # Too many digits in offset
95
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
96
 
            '2007-03-06 10:04:19 79500')
97
 
        # Minus sign in middle of offset
98
 
        self.assertRaises(ValueError, timestamp.parse_patch_date,
99
 
            '2007-03-06 10:04:19 +05-5')
100
61
 
101
62
 
102
63
class UnpackHighresDateTests(tests.TestCase):