-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from aerospike/3.1.1-release-candidate
3.1.1 release candidate
- Loading branch information
Showing
6 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.1.0 | ||
3.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import pytest | ||
import sys | ||
import json | ||
from .test_base_class import TestBaseClass | ||
from aerospike import exception as e | ||
|
||
host, user, password = TestBaseClass.get_hosts() | ||
using_auth = user or password | ||
aerospike = pytest.importorskip("aerospike") | ||
try: | ||
import aerospike | ||
except: | ||
print("Please install aerospike python client.") | ||
sys.exit(1) | ||
|
||
|
||
def test_setting_key(): | ||
key_val = aerospike.POLICY_KEY_SEND | ||
read_policy = {'key': key_val} | ||
policies = {'read': read_policy} | ||
config = {'hosts': host, 'policies': policies} | ||
client = aerospike.client(config) | ||
|
||
|
||
def test_setting_consistency(): | ||
cons_val = aerospike.POLICY_CONSISTENCY_ONE | ||
read_policy = {'consistency_level': cons_val} | ||
policies = {'read': read_policy} | ||
config = {'hosts': host, 'policies': policies} | ||
client = aerospike.client(config) | ||
|
||
|
||
def test_setting_consistency(): | ||
replica_val = aerospike.POLICY_REPLICA_MASTER | ||
read_policy = {'replica': replica_val} | ||
policies = {'read': read_policy} | ||
config = {'hosts': host, 'policies': policies} | ||
client = aerospike.client(config) | ||
|
||
|
||
def test_setting_consistency(): | ||
replica_val = aerospike.POLICY_REPLICA_MASTER | ||
read_policy = {'replica': replica_val} | ||
policies = {'read': read_policy} | ||
config = {'hosts': host, 'policies': policies} | ||
client = aerospike.client(config) | ||
|
||
|
||
def test_setting_conmmit_level(): | ||
commit_val = aerospike.POLICY_COMMIT_LEVEL_ALL | ||
write_policy = {'commit_level': commit_val} | ||
policies = {'write': write_policy} | ||
config = {'hosts': host, 'policies': policies} | ||
client = aerospike.client(config) | ||
|
||
|
||
def test_setting_exists(): | ||
exists_val = aerospike.POLICY_EXISTS_CREATE | ||
write_policy = {'commit_level': exists_val} | ||
policies = {'write': write_policy} | ||
config = {'hosts': host, 'policies': policies} | ||
client = aerospike.client(config) | ||
|
||
|
||
def test_setting_gen(): | ||
gen_val = aerospike.POLICY_GEN_IGNORE | ||
write_policy = {'commit_level': gen_val} | ||
policies = {'write': write_policy} | ||
config = {'hosts': host, 'policies': policies} | ||
client = aerospike.client(config) | ||
|
||
|
||
def test_setting_wrong_type(): | ||
write_policy = {'commit_level': [1, 2, 3]} | ||
policies = {'write': write_policy} | ||
config = {'hosts': host, 'policies': policies} | ||
with pytest.raises(e.ParamError): | ||
client = aerospike.client(config) |