コード例 #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
ファイル: test_descriptor.py プロジェクト: pcreech/pulp
 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)