本文整理汇总了Python中asq.queryables.Queryable.to_list方法的典型用法代码示例。如果您正苦于以下问题:Python Queryable.to_list方法的具体用法?Python Queryable.to_list怎么用?Python Queryable.to_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asq.queryables.Queryable
的用法示例。
在下文中一共展示了Queryable.to_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_take_is_deferred
# 需要导入模块: from asq.queryables import Queryable [as 别名]
# 或者: from asq.queryables.Queryable import to_list [as 别名]
def test_take_is_deferred(self):
a = TracingGenerator()
self.assertEqual(a.trace, [])
b = Queryable(a).take()
self.assertEqual(a.trace, [])
c = b.to_list()
self.assertEqual(a.trace, [0])
示例2: test_take_while_is_deferred
# 需要导入模块: from asq.queryables import Queryable [as 别名]
# 或者: from asq.queryables.Queryable import to_list [as 别名]
def test_take_while_is_deferred(self):
a = TracingGenerator()
self.assertEqual(a.trace, [])
b = Queryable(a).take_while(lambda x: x < 3)
self.assertEqual(a.trace, [])
c = b.to_list()
# 3 is included here in the trace because it must have been consumed in order to test
# whether it satisfies the predicate
self.assertEqual(a.trace, [0, 1, 2, 3])
示例3: test_to_list_closed
# 需要导入模块: from asq.queryables import Queryable [as 别名]
# 或者: from asq.queryables.Queryable import to_list [as 别名]
def test_to_list_closed(self):
a = [27, 74, 18, 48, 57, 97, 76, 20, 91, 8, 80, 59, 20, 32, 58, 12, 74, 78, 4]
b = Queryable(a)
b.close()
self.assertRaises(ValueError, lambda: b.to_list())