本文整理匯總了Python中subscription_manager.validity.ValidProductDateRangeCalculator._gap_exists_between方法的典型用法代碼示例。如果您正苦於以下問題:Python ValidProductDateRangeCalculator._gap_exists_between方法的具體用法?Python ValidProductDateRangeCalculator._gap_exists_between怎麽用?Python ValidProductDateRangeCalculator._gap_exists_between使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類subscription_manager.validity.ValidProductDateRangeCalculator
的用法示例。
在下文中一共展示了ValidProductDateRangeCalculator._gap_exists_between方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_gap_between
# 需要導入模塊: from subscription_manager.validity import ValidProductDateRangeCalculator [as 別名]
# 或者: from subscription_manager.validity.ValidProductDateRangeCalculator import _gap_exists_between [as 別名]
def test_gap_between(self):
start1 = self.NOW
end1 = start1 + self.THREE_MONTHS
start2 = self.NOW - self.THREE_MONTHS
end2 = start2 + self.ONE_MONTH
start3 = start2
end3 = start2 + self.TEN_DAYS
installed = create_prod_cert(self.INST_PID_1)
ent1 = self._create_entitlement(self.INST_PID_1, start1, end1)
ent2 = self._create_entitlement(self.INST_PID_1, start2, end2)
ent3 = self._create_entitlement(self.INST_PID_1, start3, end3)
sorter = create_cert_sorter([installed], [ent1, ent2, ent3])
calculator = ValidProductDateRangeCalculator(sorter)
self.assertTrue(calculator._gap_exists_between(ent1, ent2))
self.assertFalse(calculator._gap_exists_between(ent2, ent3))
self.assertFalse(calculator._gap_exists_between(ent3, ent2))
self.assertTrue(calculator._gap_exists_between(ent1, ent3))
self.assertTrue(calculator._gap_exists_between(ent2, ent1))