diff --git a/Bantracker/plugin.py b/Bantracker/plugin.py index bc5c94c..1d6492f 100644 --- a/Bantracker/plugin.py +++ b/Bantracker/plugin.py @@ -97,6 +97,7 @@ class FuzzyDict(dict): return dict.__getitem__(self, keys[0]) timeUnits = FuzzyDict({ + 'seconds': 1, 'minutes': 60, 'm': 60, 'hours' : 3600, 'M': 2592000, 'days' : 86400, diff --git a/Bantracker/test.py b/Bantracker/test.py index dbe6fae..4e5a046 100644 --- a/Bantracker/test.py +++ b/Bantracker/test.py @@ -512,10 +512,12 @@ class BantrackerTestCase(ChannelPluginTestCase): self.assertEqual(cb.managedBans.shelf[0].expires, 172860) self.assertNotError('duration 1 24h 1day') self.assertEqual(cb.managedBans.shelf[0].expires, 172800) - self.assertNotError('duration 1 1m1h1d1w1M1y') - self.assertEqual(cb.managedBans.shelf[0].expires, 34822860) + self.assertNotError('duration 1 1s1m1h1d1w1M1y') + self.assertEqual(cb.managedBans.shelf[0].expires, 34822861) self.assertNotError('duration 1 999') self.assertEqual(cb.managedBans.shelf[0].expires, 999) + self.assertNotError('duration 1 1 second') + self.assertEqual(cb.managedBans.shelf[0].expires, 1) def testDurationTimeFormatBad(self): self.assertError('duration 1 10 apples')