コード例 #1
0
 def test_select_many_with_index_closed(self):
     a = [{'name' : 'Alice', 'flowers' : ['Agapanthus', 'Allium', 'Alpina', 'Alstroemeria', 'Amaranthus', 'Amarylis' ] },
          {'name' : 'Bob',   'flowers' : ['Bouvardia' ]},
          {'name' : 'Chris', 'flowers' : ['Carnations', 'Cattleya', 'Celosia', 'Chincherinchee', 'Chrysanthemum']}]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.select_many_with_index(lambda i, x: [str(i) + flower for flower in x['flowers']]))
コード例 #2
0
 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())
コード例 #3
0
ファイル: test_select_with_args.py プロジェクト: abingham/asq
 def test_select_with_args_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.select_with_args(lambda x: x * 2))
コード例 #4
0
ファイル: test_group_by.py プロジェクト: abingham/asq
 def test_first_closed(self):
     a = [
         'Agapanthus', 'Allium', 'Alpina', 'Alstroemeria', 'Amaranthus',
         'Amarylis', 'Bouvardia', 'Carnations', 'Cattleya', 'Celosia',
         'Chincherinchee', 'Chrysanthemum'
     ]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.group_by(lambda x: x[0]))
コード例 #5
0
 def test_to_unicode_closed(self):
     a = [
         u('Aardvark'),
         u('Balloon'),
         u('Carrot'),
         u('Daisy'),
         u('Ecological')
     ]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: unicode(b))
コード例 #6
0
 def test_select_many_with_index_closed(self):
     a = [{
         'name':
         'Alice',
         'flowers': [
             'Agapanthus', 'Allium', 'Alpina', 'Alstroemeria', 'Amaranthus',
             'Amarylis'
         ]
     }, {
         'name': 'Bob',
         'flowers': ['Bouvardia']
     }, {
         'name':
         'Chris',
         'flowers': [
             'Carnations', 'Cattleya', 'Celosia', 'Chincherinchee',
             'Chrysanthemum'
         ]
     }]
     b = Queryable(a)
     b.close()
     self.assertRaises(
         ValueError, lambda: b.select_many_with_index(
             lambda i, x: [str(i) + flower for flower in x['flowers']]))
コード例 #7
0
ファイル: test_as_parallel.py プロジェクト: Max1412/101worker
 def test_as_parallel_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.as_parallel())
コード例 #8
0
ファイル: test_where.py プロジェクト: Dror-LightCyber/asq
 def test_where_closed(self):
     a = range(0, 100)
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.where(lambda x: x % 3 == 0))
コード例 #9
0
ファイル: test_getitem.py プロジェクト: narula/asq
 def test_getitem_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b[0])
コード例 #10
0
ファイル: test_getitem.py プロジェクト: Dror-LightCyber/asq
 def test_getitem_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b[0])
コード例 #11
0
 def test_aggregate_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.aggregate(operator.add, 72))
コード例 #12
0
ファイル: test_to_str.py プロジェクト: pombredanne/asq
 def test_to_str_closed(self):
     a = ['Aardvark', 'Balloon', 'Carrot', 'Daisy', 'Ecological']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.to_str())
コード例 #13
0
 def test_contains_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.contains(5))
コード例 #14
0
ファイル: test_pre_scan.py プロジェクト: scls19fr/asq
 def test_pre_scan_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.pre_scan())
コード例 #15
0
 def test_select_closed(self):
     b = Queryable([1, 2, 4, 8])
     b.close()
     self.assertRaises(ValueError, lambda: b.select(lambda x: x * 2))
コード例 #16
0
ファイル: test_union.py プロジェクト: pombredanne/asq
 def test_union_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.union([1, 2, 3]))
コード例 #17
0
ファイル: test_last.py プロジェクト: narula/asq
 def test_last_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.last())
コード例 #18
0
 def test_skip_while_closed(self):
     a = [1, 2, 3, 4]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.skip_while(lambda x : x < 2))
コード例 #19
0
 def test_to_set_closed(self):
     a = [1, 2, 4, 8, 16, 32]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.to_set())
コード例 #20
0
 def test_average_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.average())
コード例 #21
0
 def test_max_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.max())
コード例 #22
0
ファイル: test_sum.py プロジェクト: narula/asq
 def test_sum_closed(self):
     a = [5, 7, -3, 2, 1, 9, 3, 2, 1, -8, 7]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.sum())
コード例 #23
0
ファイル: test_last.py プロジェクト: Dror-LightCyber/asq
 def test_last_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.last())
コード例 #24
0
ファイル: test_intersect.py プロジェクト: narula/asq
 def test_intersect_closed(self):
     a = [1, 1, 2, 2, 4, 5, 3]
     b = [2, 5, 5]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.intersect(b))
コード例 #25
0
ファイル: test_reverse.py プロジェクト: scls19fr/asq
 def test_reverse_closed(self):
     b = Queryable([1, 2, 4, 8])
     b.close()
     self.assertRaises(ValueError, lambda: b.reverse())
コード例 #26
0
ファイル: test_of_type.py プロジェクト: Max1412/101worker
 def test_of_type_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.of_type(str))
コード例 #27
0
ファイル: test_single.py プロジェクト: scls19fr/asq
 def test_single_closed(self):
     a = [5]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.single())
コード例 #28
0
ファイル: test_distinct.py プロジェクト: Dror-LightCyber/asq
 def test_distinct_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.distinct())
コード例 #29
0
ファイル: test_single.py プロジェクト: Dror-LightCyber/asq
 def test_single_closed(self):
     a = [5]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.single())
コード例 #30
0
ファイル: test_default_if_empty.py プロジェクト: scls19fr/asq
 def test_default_if_empty_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.default_if_empty(5))
コード例 #31
0
ファイル: test_take.py プロジェクト: Max1412/101worker
 def test_take_closed(self):
     a = ['a', 'b', 'c']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.take(1))
コード例 #32
0
 def test_sequence_equal_closed(self):
     a = [1, 2, 3, 4, 16, 32]
     b = (1, 2, 3, 4, 16, 32)
     c = Queryable(a)
     c.close()
     self.assertRaises(ValueError, lambda: c.sequence_equal(b))
コード例 #33
0
 def test_default_if_empty_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.default_if_empty(5))
コード例 #34
0
ファイル: test_difference.py プロジェクト: pombredanne/asq
 def test_difference_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.difference([2, 5]))
     
コード例 #35
0
 def test_first_or_default_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.first_or_default(37))
コード例 #36
0
 def test_take_while_closed(self):
     a = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.take_while(lambda x: x < 'e'))
コード例 #37
0
 def test_join_closed(self):
     a = [1, 2, 3, 4, 5]
     b = [4, 5, 6, 7, 8]
     c = Queryable(a)
     c.close()
     self.assertRaises(ValueError, lambda: c.join(b))
コード例 #38
0
 def test_to_dictionary_closed(self):
     a = ['Aardvark', 'Balloon', 'Carrot', 'Daisy', 'Ecological']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.to_dictionary())
コード例 #39
0
 def test_select_with_index_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.select_with_index(lambda x, y: x*y))
コード例 #40
0
ファイル: test_intersect.py プロジェクト: pombredanne/asq
 def test_intersect_closed(self):
     a = [1, 1, 2, 2, 4, 5, 3]
     b = [2, 5, 5]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.intersect(b))
コード例 #41
0
 def test_select_many_closed(self):
     b = Queryable([1, 2, 4, 8])
     b.close()
     self.assertRaises(ValueError, lambda: b.select_many(lambda x: x * 2))
コード例 #42
0
ファイル: test_join.py プロジェクト: pombredanne/asq
 def test_join_closed(self):
     a = [1, 2, 3, 4, 5]
     b = [4, 5, 6, 7, 8]
     c = Queryable(a)
     c.close()
     self.assertRaises(ValueError, lambda: c.join(b))
コード例 #43
0
 def test_group_join_closed(self):
     a = [1, 2]
     b = [2, 3]
     c = Queryable(a)
     c.close()
     self.assertRaises(ValueError, lambda: c.group_join(b))
コード例 #44
0
 def test_element_at_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.element_at(0))
コード例 #45
0
ファイル: test_element_at.py プロジェクト: Max1412/101worker
 def test_element_at_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.element_at(0))
コード例 #46
0
 def test_to_unicode_closed(self):
     a = [u('Aardvark'), u('Balloon'), u('Carrot'), u('Daisy'), u('Ecological')]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: unicode(b))
コード例 #47
0
 def test_first_closed(self):
     a = ['Agapanthus', 'Allium', 'Alpina', 'Alstroemeria', 'Amaranthus', 'Amarylis', 'Bouvardia', 'Carnations',
          'Cattleya', 'Celosia', 'Chincherinchee', 'Chrysanthemum']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.group_by(lambda x: x[0]))
コード例 #48
0
 def test_skip_while_closed(self):
     a = [1, 2, 3, 4]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.skip_while(lambda x: x < 2))
コード例 #49
0
ファイル: test_skip.py プロジェクト: GitHubTianPeng/101worker
 def test_skip_closed(self):
     a = ['a', 'b', 'c']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.skip(1))
コード例 #50
0
ファイル: test_log.py プロジェクト: pombredanne/asq
 def test_log_closed(self):
     a = [1, 6, 4, 3, 9, 2]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.log())
コード例 #51
0
ファイル: test_contains.py プロジェクト: pombredanne/asq
 def test_contains_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.contains(5))
コード例 #52
0
 def test_group_join_closed(self):
     a = [1, 2]
     b = [2, 3]
     c = Queryable(a)
     c.close()
     self.assertRaises(ValueError, lambda: c.group_join(b))
コード例 #53
0
ファイル: test_aggregate.py プロジェクト: Dror-LightCyber/asq
 def test_aggregate_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.aggregate(operator.add, 72))
コード例 #54
0
ファイル: test_concat.py プロジェクト: narula/asq
 def test_concat_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.concat([2]))
コード例 #55
0
ファイル: test_any.py プロジェクト: Dror-LightCyber/asq
 def test_any_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.any())
コード例 #56
0
 def test_concat_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.concat([2]))
コード例 #57
0
 def test_as_parallel_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.as_parallel())
コード例 #58
0
ファイル: test_to_set.py プロジェクト: pombredanne/asq
 def test_to_set_closed(self):
     a = [1, 2, 4, 8, 16, 32]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.to_set())