import unittest
from limits import limits


class GranularityTests(unittest.TestCase):
    def test_seconds_value(self):
        self.assertEqual(limits.RateLimitItemPerHour(1).get_expiry(), 60*60)
        self.assertEqual(limits.RateLimitItemPerMinute(1).get_expiry(), 60)
        self.assertEqual(limits.RateLimitItemPerSecond(1).get_expiry(), 1)
        self.assertEqual(limits.RateLimitItemPerDay(1).get_expiry(), 60*60*24)
        self.assertEqual(limits.RateLimitItemPerMonth(1).get_expiry(), 60*60*24*30)
        self.assertEqual(limits.RateLimitItemPerYear(1).get_expiry(), 60*60*24*30*12)

    def test_representation(self):
        self.assertTrue("1 per 1 hour" in str(limits.RateLimitItemPerHour(1)))
        self.assertTrue("1 per 1 minute" in str(limits.RateLimitItemPerMinute(1)))
        self.assertTrue("1 per 1 second" in str(limits.RateLimitItemPerSecond(1)))
        self.assertTrue("1 per 1 day" in str(limits.RateLimitItemPerDay(1)))
        self.assertTrue("1 per 1 month" in str(limits.RateLimitItemPerMonth(1)))
        self.assertTrue("1 per 1 year" in str(limits.RateLimitItemPerYear(1)))

@@ -1105,12 +1105,495 @@
 erYear(1)))%0A
+%0A    def test_comparison(self):%0A        self.assertTrue(limits.RateLimitItemPerSecond(1) %3C limits.RateLimitItemPerMinute(1))%0A        self.assertTrue(limits.RateLimitItemPerMinute(1) %3C limits.RateLimitItemPerHour(1))%0A        self.assertTrue(limits.RateLimitItemPerHour(1) %3C limits.RateLimitItemPerDay(1))%0A        self.assertTrue(limits.RateLimitItemPerDay(1) %3C limits.RateLimitItemPerMonth(1))%0A        self.assertTrue(limits.RateLimitItemPerMonth(1) %3C limits.RateLimitItemPerYear(1))%0A

add test for rate limit comparison (lt)