本文整理汇总了Python中asq.test.test_queryable.infinite函数的典型用法代码示例。如果您正苦于以下问题:Python infinite函数的具体用法?Python infinite怎么用?Python infinite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了infinite函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_group_join_infinite
def test_group_join_infinite(self):
a = infinite()
b = [2, 3, 5]
c = Queryable(a).group_join(b).take(3).to_list()
self.assertEqual(c[0].key, 0)
self.assertEqual(len(c[0]), 0)
self.assertEqual(c[1].key, 1)
self.assertEqual(len(c[1]), 0)
self.assertEqual(c[2].key, 2)
self.assertEqual(len(c[2]), 1)
self.assertTrue(2 in c[2])
开发者ID:Dror-LightCyber,项目名称:asq,代码行数:14,代码来源:test_group_join.py
示例2: test_ne_infinite_finite
def test_ne_infinite_finite(self):
a = (1, 2, 3, 5, 16, 32)
b = infinite()
c = Queryable(a) != b
self.assertTrue(c)
开发者ID:Dror-LightCyber,项目名称:asq,代码行数:5,代码来源:test_relational.py
示例3: test_any_infinite
def test_any_infinite(self):
b = Queryable(infinite()).any()
self.assertTrue(b)
开发者ID:Dror-LightCyber,项目名称:asq,代码行数:3,代码来源:test_any.py
示例4: test_getitem_infinite
def test_getitem_infinite(self):
b = Queryable(infinite())[5]
self.assertEqual(b, 5)
开发者ID:Dror-LightCyber,项目名称:asq,代码行数:3,代码来源:test_getitem.py
示例5: test_skip_from_infinite
def test_skip_from_infinite(self):
b = Queryable(infinite()).skip(5).take(3).to_list()
c = [5, 6, 7]
self.assertEqual(b, c)
开发者ID:GitHubTianPeng,项目名称:101worker,代码行数:4,代码来源:test_skip.py
示例6: test_select_many_infinite
def test_select_many_infinite(self):
a = infinite()
b = Queryable(a).select_many(lambda x: [x] * x).take(10).to_list()
c = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]
self.assertEqual(b, c)
开发者ID:Dror-LightCyber,项目名称:asq,代码行数:5,代码来源:test_select_many.py
示例7: test_first_or_default_infinite
def test_first_or_default_infinite(self):
b = Queryable(infinite()).first_or_default(37)
self.assertEqual(b, 0)
开发者ID:GitHubTianPeng,项目名称:101worker,代码行数:3,代码来源:test_first_or_default.py
示例8: test_concat_infinite
def test_concat_infinite(self):
b = Queryable(infinite()).concat(infinite()).take(3).to_list()
c = [0, 1, 2]
self.assertEqual(b, c)
开发者ID:GitHubTianPeng,项目名称:101worker,代码行数:4,代码来源:test_concat.py
示例9: test_difference_infinite
def test_difference_infinite(self):
b = [3, 7, 2, 9, 10]
c = Queryable(infinite()).difference(b).take(10).to_list()
d = [0, 1, 4, 5, 6, 8, 11, 12, 13, 14]
self.assertEqual(c, d)
开发者ID:pombredanne,项目名称:asq,代码行数:5,代码来源:test_difference.py
示例10: test_intersect_infinite
def test_intersect_infinite(self):
b = [3, 7, 2, 9, 10]
c = Queryable(infinite()).intersect(b).take(5).to_list()
d = [2, 3, 7, 9, 10]
self.assertEqual(c, d)
开发者ID:pombredanne,项目名称:asq,代码行数:5,代码来源:test_intersect.py
示例11: test_zip_infinite
def test_zip_infinite(self):
c = Queryable(infinite()).zip(infinite()).take(4).to_list()
self.assertEqual(c, [(0, 0), (1, 1), (2, 2), (3, 3)])
开发者ID:pombredanne,项目名称:asq,代码行数:3,代码来源:test_zip.py
示例12: test_reversed_non_sequence
def test_reversed_non_sequence(self):
a = infinite()
b = list(reversed(Queryable(a).take(10)))
c = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
self.assertEqual(b, c)
开发者ID:Dror-LightCyber,项目名称:asq,代码行数:5,代码来源:test_reversed.py
示例13: test_select_infinite
def test_select_infinite(self):
a = infinite()
b = Queryable(a).select(lambda x: x*2).take(3).to_list()
c = [0, 2, 4]
self.assertEqual(b, c)
开发者ID:MartinFSchmitz,项目名称:101worker,代码行数:5,代码来源:test_select.py
示例14: test_sequence_equal_infinite_finite
def test_sequence_equal_infinite_finite(self):
a = (1, 2, 3, 5, 16, 32)
b = infinite()
c = Queryable(a).sequence_equal(b)
self.assertFalse(c)
开发者ID:pombredanne,项目名称:asq,代码行数:5,代码来源:test_sequence_equal.py
示例15: test_eq_infinite_finite
def test_eq_infinite_finite(self):
a = (1, 2, 3, 5, 16, 32)
b = infinite()
c = Queryable(a) == b
self.assertFalse(c)
开发者ID:Dror-LightCyber,项目名称:asq,代码行数:5,代码来源:test_relational.py
示例16: test_element_at_out_of_range_infinite
def test_element_at_out_of_range_infinite(self):
self.assertRaises(ValueError, lambda: Queryable(infinite()).element_at(-1))
开发者ID:GitHubTianPeng,项目名称:101worker,代码行数:2,代码来源:test_element_at.py
示例17: test_element_at_infinite
def test_element_at_infinite(self):
b = Queryable(infinite()).element_at(5)
self.assertEqual(b, 5)
开发者ID:GitHubTianPeng,项目名称:101worker,代码行数:3,代码来源:test_element_at.py
示例18: test_where_infinite
def test_where_infinite(self):
a = infinite()
b = Queryable(a).where(lambda x: x % 5 == 0).take(3).to_list()
c = [0, 5, 10]
self.assertEqual(b, c)
开发者ID:Dror-LightCyber,项目名称:asq,代码行数:5,代码来源:test_where.py
示例19: test_default_if_empty_infinite
def test_default_if_empty_infinite(self):
b = Queryable(infinite()).default_if_empty(42).take(5).to_list()
self.assertEqual(b, [0, 1, 2, 3, 4])
开发者ID:pombredanne,项目名称:asq,代码行数:3,代码来源:test_default_if_empty.py
示例20: test_union_infinite
def test_union_infinite(self):
b = [3, 7, 2, 9, 10]
c = Queryable(infinite()).union(b).take(5).to_list()
d = [0, 1, 2, 3, 4]
self.assertEqual(c, d)
开发者ID:pombredanne,项目名称:asq,代码行数:5,代码来源:test_union.py
注:本文中的asq.test.test_queryable.infinite函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论