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']]))
Exemplo n.º 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())
Exemplo n.º 3
0
 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))
Exemplo n.º 4
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]))
Exemplo n.º 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))
 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']]))
Exemplo n.º 7
0
 def test_as_parallel_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.as_parallel())
Exemplo n.º 8
0
 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))
Exemplo n.º 9
0
 def test_getitem_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b[0])
Exemplo n.º 10
0
 def test_getitem_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b[0])
Exemplo n.º 11
0
 def test_aggregate_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.aggregate(operator.add, 72))
Exemplo n.º 12
0
 def test_to_str_closed(self):
     a = ['Aardvark', 'Balloon', 'Carrot', 'Daisy', 'Ecological']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.to_str())
Exemplo n.º 13
0
 def test_contains_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.contains(5))
Exemplo n.º 14
0
 def test_pre_scan_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.pre_scan())
Exemplo n.º 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))
Exemplo n.º 16
0
 def test_union_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.union([1, 2, 3]))
Exemplo n.º 17
0
 def test_last_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.last())
Exemplo n.º 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))
Exemplo n.º 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())
Exemplo n.º 20
0
 def test_average_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.average())
Exemplo n.º 21
0
 def test_max_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.max())
Exemplo n.º 22
0
 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())
Exemplo n.º 23
0
 def test_last_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.last())
Exemplo n.º 24
0
 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))
Exemplo n.º 25
0
 def test_reverse_closed(self):
     b = Queryable([1, 2, 4, 8])
     b.close()
     self.assertRaises(ValueError, lambda: b.reverse())
Exemplo n.º 26
0
 def test_of_type_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.of_type(str))
Exemplo n.º 27
0
 def test_single_closed(self):
     a = [5]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.single())
Exemplo n.º 28
0
 def test_distinct_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.distinct())
Exemplo n.º 29
0
 def test_single_closed(self):
     a = [5]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.single())
Exemplo n.º 30
0
 def test_default_if_empty_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.default_if_empty(5))
Exemplo n.º 31
0
 def test_take_closed(self):
     a = ['a', 'b', 'c']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.take(1))
Exemplo n.º 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))
Exemplo n.º 33
0
 def test_default_if_empty_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.default_if_empty(5))
Exemplo n.º 34
0
 def test_difference_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.difference([2, 5]))
     
Exemplo n.º 35
0
 def test_first_or_default_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.first_or_default(37))
Exemplo n.º 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'))
Exemplo n.º 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))
Exemplo n.º 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())
Exemplo n.º 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))
Exemplo n.º 40
0
 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))
Exemplo n.º 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))
Exemplo n.º 42
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))
Exemplo n.º 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))
Exemplo n.º 44
0
 def test_element_at_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.element_at(0))
Exemplo n.º 45
0
 def test_element_at_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.element_at(0))
Exemplo n.º 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))
Exemplo n.º 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]))
Exemplo n.º 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))
Exemplo n.º 49
0
 def test_skip_closed(self):
     a = ['a', 'b', 'c']
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.skip(1))
Exemplo n.º 50
0
 def test_log_closed(self):
     a = [1, 6, 4, 3, 9, 2]
     b = Queryable(a)
     b.close()
     self.assertRaises(ValueError, lambda: b.log())
Exemplo n.º 51
0
 def test_contains_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.contains(5))
Exemplo n.º 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))
Exemplo n.º 53
0
 def test_aggregate_closed(self):
     b = Queryable([])
     b.close()
     self.assertRaises(ValueError, lambda: b.aggregate(operator.add, 72))
Exemplo n.º 54
0
 def test_concat_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.concat([2]))
Exemplo n.º 55
0
 def test_any_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.any())
Exemplo n.º 56
0
 def test_concat_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.concat([2]))
Exemplo n.º 57
0
 def test_as_parallel_closed(self):
     b = Queryable([1])
     b.close()
     self.assertRaises(ValueError, lambda: b.as_parallel())
Exemplo n.º 58
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())