本文整理汇总了Python中asq.test.test_queryable.infinite函数的典型用法代码示例。如果您正苦于以下问题:Python infinite函数的具体用法?Python infinite怎么用?Python infinite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了infinite函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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])
示例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)
示例3: test_any_infinite
def test_any_infinite(self):
b = Queryable(infinite()).any()
self.assertTrue(b)
示例4: test_getitem_infinite
def test_getitem_infinite(self):
b = Queryable(infinite())[5]
self.assertEqual(b, 5)
示例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)
示例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)
示例7: test_first_or_default_infinite
def test_first_or_default_infinite(self):
b = Queryable(infinite()).first_or_default(37)
self.assertEqual(b, 0)
示例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)
示例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)
示例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)
示例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)])
示例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)
示例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)
示例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)
示例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)