本文整理匯總了Python中auvsi_suas.models.AccessLog.by_time_period方法的典型用法代碼示例。如果您正苦於以下問題:Python AccessLog.by_time_period方法的具體用法?Python AccessLog.by_time_period怎麽用?Python AccessLog.by_time_period使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類auvsi_suas.models.AccessLog
的用法示例。
在下文中一共展示了AccessLog.by_time_period方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_open_end
# 需要導入模塊: from auvsi_suas.models import AccessLog [as 別名]
# 或者: from auvsi_suas.models.AccessLog import by_time_period [as 別名]
def test_open_end(self):
"""Logs (2003, inf)"""
results = AccessLog.by_time_period(self.user1, [
TimePeriod(self.year2003, None),
])
self.assertSequenceEqual([self.year2003_logs], self.to_lists(results))
示例2: test_non_intersecting_period
# 需要導入模塊: from auvsi_suas.models import AccessLog [as 別名]
# 或者: from auvsi_suas.models.AccessLog import by_time_period [as 別名]
def test_non_intersecting_period(self):
"""No logs matched."""
results = AccessLog.by_time_period(self.user1, [
TimePeriod(self.year2001, self.year2002),
])
self.assertSequenceEqual([[]], self.to_lists(results))
示例3: test_open_start
# 需要導入模塊: from auvsi_suas.models import AccessLog [as 別名]
# 或者: from auvsi_suas.models.AccessLog import by_time_period [as 別名]
def test_open_start(self):
"""Logs (-inf, 2001)"""
results = AccessLog.by_time_period(self.user1, [
TimePeriod(None, self.year2001),
])
self.assertSequenceEqual([self.year2000_logs], self.to_lists(results))
示例4: test_full_range
# 需要導入模塊: from auvsi_suas.models import AccessLog [as 別名]
# 或者: from auvsi_suas.models.AccessLog import by_time_period [as 別名]
def test_full_range(self):
"""All logs from (-inf, inf)."""
results = AccessLog.by_time_period(self.user1, [
TimePeriod(None, None)
])
self.assertSequenceEqual([self.logs], self.to_lists(results))
示例5: test_single_period
# 需要導入模塊: from auvsi_suas.models import AccessLog [as 別名]
# 或者: from auvsi_suas.models.AccessLog import by_time_period [as 別名]
def test_single_period(self):
"""Single set of logs accessible."""
results = AccessLog.by_time_period(self.user1, [
TimePeriod(self.year2000, self.year2001)
])
self.assertSequenceEqual([self.year2000_logs], self.to_lists(results))
示例6: test_one_intersecting_period
# 需要導入模塊: from auvsi_suas.models import AccessLog [as 別名]
# 或者: from auvsi_suas.models.AccessLog import by_time_period [as 別名]
def test_one_intersecting_period(self):
"""Only one period matches logs."""
results = AccessLog.by_time_period(self.user1, [
TimePeriod(self.year2001, self.year2002),
TimePeriod(self.year2003, self.year2004),
])
self.assertSequenceEqual(
[[], self.year2003_logs], self.to_lists(results))
示例7: test_both_periods
# 需要導入模塊: from auvsi_suas.models import AccessLog [as 別名]
# 或者: from auvsi_suas.models.AccessLog import by_time_period [as 別名]
def test_both_periods(self):
"""Both sets of logs, accesses individually."""
results = AccessLog.by_time_period(self.user1, [
TimePeriod(self.year2000, self.year2001),
TimePeriod(self.year2003, self.year2004),
])
self.assertSequenceEqual(
[self.year2000_logs, self.year2003_logs], self.to_lists(results))
示例8: test_no_data
# 需要導入模塊: from auvsi_suas.models import AccessLog [as 別名]
# 或者: from auvsi_suas.models.AccessLog import by_time_period [as 別名]
def test_no_data(self):
logs = AccessLog.by_user(self.user1)
self.assertEqual(len(logs), 0)
logs = AccessLog.by_time_period(self.user1, [])
self.assertEqual(len(logs), 0)
log_rates = AccessLog.rates(self.user1, [])
self.assertTupleEqual(log_rates, (None, None))