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'))
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])
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)