예제 #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'))
예제 #2
0
파일: model.py 프로젝트: CUXIDUMDUM/pulp
 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])
예제 #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)
예제 #4
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)
예제 #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)