Beispiel #1
0
 def expires(self):
     """
     Get the duration in seconds of how long content catalog entries
     may exist in the catalog before expiring.  Expired catalog
     entries are ignored and eventually purged.
     :return: The expiration in seconds.
     :rtype int
     """
     return to_seconds(self.descriptor.get(constants.EXPIRES, '24h'))
Beispiel #2
0
 def expires(self):
     """
     Get the duration in seconds of how long content catalog entries
     may exist in the catalog before expiring.  Expired catalog
     entries are ignored and eventually purged.
     :return: The expiration in seconds.
     :rtype int
     """
     return to_seconds(self.descriptor[constants.EXPIRES])
Beispiel #3
0
 def test_to_seconds(self):
     self.assertEqual(to_seconds('10'), 10)
     self.assertEqual(to_seconds('10s'), 10)
     self.assertEqual(to_seconds('10m'), 600)
     self.assertEqual(to_seconds('10h'), 36000)
     self.assertEqual(to_seconds('10d'), 864000)
 def test_to_seconds(self):
     self.assertEqual(to_seconds('10'), 10)
     self.assertEqual(to_seconds('10s'), 10)
     self.assertEqual(to_seconds('10m'), 600)
     self.assertEqual(to_seconds('10h'), 36000)
     self.assertEqual(to_seconds('10d'), 864000)
Beispiel #5
0
 def test_to_seconds(self):
     self.assertEqual(to_seconds("10"), 10)
     self.assertEqual(to_seconds("10s"), 10)
     self.assertEqual(to_seconds("10m"), 600)
     self.assertEqual(to_seconds("10h"), 36000)
     self.assertEqual(to_seconds("10d"), 864000)