We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 948fd06 commit 8cc2bc4Copy full SHA for 8cc2bc4
riak/mapreduce.py
@@ -83,14 +83,14 @@ def add_bucket(self, bucket):
83
84
def add_key_filters(self, key_filters):
85
if self._input_mode == 'query':
86
- raise Exception('Key filters are not supported in a query.')
+ raise ValueError('Key filters are not supported in a query.')
87
88
self._key_filters.extend(key_filters)
89
return self
90
91
def add_key_filter(self, *args):
92
93
94
95
self._key_filters.append(args)
96
riak/tests/test_mapreduce.py
@@ -83,6 +83,27 @@ def test_erlang_map_reduce(self):
.run()
self.assertEqual(len(result), 2)
+ def test_client_exceptional_paths(self):
+ bucket = self.client.bucket('bucket')
+ bucket.new("foo", 2).store()
+ bucket.new("bar", 2).store()
+ bucket.new("baz", 4).store()
+
+ #adding a b-key pair to a bucket input
+ with self.assertRaises(ValueError):
+ mr = self.client.add('bucket')
+ mr.add('bucket', 'bar')
97
+ #adding a b-key pair to a query input
98
99
+ mr = self.client.search('bucket', 'fleh')
100
101
102
+ #adding a key filter to a query input
103
104
105
+ mr.add_key_filter("tokenize", "-", 1)
106
107
108
class JSMapReduceTests(object):
109
def test_javascript_source_map(self):
0 commit comments