summaryrefslogtreecommitdiff
path: root/rdiff-backup/testing/timetest.py
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-24 17:48:57 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-24 17:48:57 +0000
commit9b6416eaf5e1691d2e640a5da2a14b4efac38348 (patch)
tree97b729eac13f4534f8712a056ece478c126600a0 /rdiff-backup/testing/timetest.py
parent2b607c5539d60002ee56c0275ead5c798d5a403b (diff)
downloadrdiff-backup-9b6416eaf5e1691d2e640a5da2a14b4efac38348.tar.gz
Added tests for prettier statistics printing, stats averaging
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@107 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing/timetest.py')
-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 d56f420..7d8fd3a 100644
--- a/rdiff-backup/testing/timetest.py
+++ b/rdiff-backup/testing/timetest.py
@@ -77,6 +77,14 @@ class TimeTest(unittest.TestCase):
assert i2s("1M2W4D2h5m20s") == (30*86400 + 2*7*86400 + 4*86400 +
2*3600 + 5*60 + 20)
+ def testPrettyIntervals(self):
+ """Test printable interval conversion"""
+ assert Time.inttopretty(3600) == "1 hour"
+ assert Time.inttopretty(7220) == "2 hours 20 seconds"
+ assert Time.inttopretty(0) == "0 seconds"
+ assert Time.inttopretty(353) == "5 minutes 53 seconds"
+ assert Time.inttopretty(3661) == "1 hour 1 minute 1 second"
+
def testGenericString(self):
"""Test genstrtotime, conversion of arbitrary string to time"""
g2t = Time.genstrtotime