Skip to content

Commit

Permalink
Add a test for non integer flag
Browse files Browse the repository at this point in the history
  • Loading branch information
aerospikerobertmarks committed Nov 14, 2018
1 parent c866b59 commit 5ae88af
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/new_tests/test_map_write_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,26 @@ def test_no_fail_does_not_allow_partial_write(self):
assert 'new1' not in map_bin
assert 'new2' not in map_bin


def test_non_int_write_flag_raises_exception(self):
skip_less_than_430(self.server_version)
key = 'test', 'write_flags', 1
self.keys.append(key)
self.as_connection.put(key, {'map': {'existing': 'old'}})

map_policy = {
'map_write_flags': "waving flag"
}
ops = [
map_ops.map_put_items(
'map',
{
'existing': 'new',
'new1': 'new1',
'new2': 'new2'
},
map_policy=map_policy),
]

with pytest.raises(e.ParamError):
self.as_connection.operate(key, ops)

0 comments on commit 5ae88af

Please sign in to comment.