summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2006-02-23 02:57:19 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2006-02-23 02:57:19 +0000
commit1f00040a3541728a517176d318f0c099a3f813c1 (patch)
tree5caecf363a4d135e779ff40e6cf6301abce5692e /rdiff-backup/testing
parenta8190e19465aacc659c246123213c53d7f562f28 (diff)
downloadrdiff-backup-1f00040a3541728a517176d318f0c099a3f813c1.tar.gz
Times like "Mon Jun 5 11:00:23 1997" now recognized
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@757 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing')
-rw-r--r--rdiff-backup/testing/timetest.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/rdiff-backup/testing/timetest.py b/rdiff-backup/testing/timetest.py
index 56052ca..24c0cf9 100644
--- a/rdiff-backup/testing/timetest.py
+++ b/rdiff-backup/testing/timetest.py
@@ -72,6 +72,14 @@ class TimeTest(unittest.TestCase):
assert Time.inttopretty(3661) == "1 hour 1 minute 1 second"
assert Time.inttopretty(353.234234) == "5 minutes 53.23 seconds"
+ def testPrettyTimes(self):
+ """Convert seconds to pretty and back"""
+ now = int(time.time())
+ for i in [1, 200000, now]:
+ assert Time.prettytotime(Time.timetopretty(i)) == i, i
+ assert Time.prettytotime("now") is None
+ assert Time.prettytotime("12314") is None
+
def testGenericString(self):
"""Test genstrtotime, conversion of arbitrary string to time"""
g2t = Time.genstrtotime