diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-04-06 05:51:59 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-04-06 05:51:59 +0000 |
commit | 5a8298c0c2c2569c3f3c508d1a0df4bca71ddf8a (patch) | |
tree | 5323c1e8f0a1509900eedf5e8561f6a4d6381a92 /rdiff-backup/testing | |
parent | cf7284af553cb1e4eb622369f82453165a392a7a (diff) | |
download | rdiff-backup-5a8298c0c2c2569c3f3c508d1a0df4bca71ddf8a.tar.gz |
Another timezone fix, in response to bug Randall Nortman reported
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@576 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing')
-rw-r--r-- | rdiff-backup/testing/timetest.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rdiff-backup/testing/timetest.py b/rdiff-backup/testing/timetest.py index 0ab8514..56052ca 100644 --- a/rdiff-backup/testing/timetest.py +++ b/rdiff-backup/testing/timetest.py @@ -94,5 +94,17 @@ class TimeTest(unittest.TestCase): self.assertRaises(Time.TimeException, g2t, "") self.assertRaises(Time.TimeException, g2t, "3q") + def testTimeZone(self): + """Test stringtotime on two strings straddling timezones""" + f = Time.stringtotime + invf = Time.timetostring + s1 = "2005-04-03T03:45:03-03:00" + s2 = "2005-04-03T02:45:03-03:00" + diff = f(s1) - f(s2) + assert diff == 3600, diff + + assert f(invf(f(s1))) == f(s1), (s1, invf(f(s1)), f(invf(f(s1))), f(s1)) + assert f(invf(f(s2))) == f(s2), (s2, f(invf(f(s2))), f(s2)) + if __name__ == '__main__': unittest.main() |