diff --git a/test/old_tests/counter26.py b/test/counter26.py similarity index 100% rename from test/old_tests/counter26.py rename to test/counter26.py diff --git a/test/new_tests/test_get_put.py b/test/new_tests/test_get_put.py index 3ab40958e..302d2cc45 100644 --- a/test/new_tests/test_get_put.py +++ b/test/new_tests/test_get_put.py @@ -6,9 +6,9 @@ import cPickle as pickle except: import pickle -from collections import OrderedDict -from .test_base_class import TestBaseClass +# from collections import OrderedDict +from .test_base_class import TestBaseClass aerospike = pytest.importorskip("aerospike") try: import aerospike @@ -17,6 +17,7 @@ print("Please install aerospike python client.") sys.exit(1) + class SomeClass(object): pass @@ -48,9 +49,9 @@ class TestGetPut(): (('test', 'demo', 'map_key'), {'names': {'name': 'John', 'age': 24}}), (('test', 'demo', 'map_key_float'), {"double_map": {"1": 3.141,"2": 4.123,"3": 6.285}}), (('test', 'demo', 'map_key_unicode'), {'a': {u'aa': u'11'}, 'b': {u'bb': u'22'}}), - (('test', 'demo', 1), - {'odict': OrderedDict(sorted({'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}.items(), - key=lambda t: t[0]))}), + # (('test', 'demo', 1), + # {'odict': OrderedDict(sorted({'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}.items(), + # key=lambda t: t[0]))}), # Tuple Data (('test', 'demo', 'tuple_key'), {'tuple_seq': tuple('abc')}), @@ -780,13 +781,13 @@ def test_neg_put_with_string_record_without_connection(self): assert exception.code == 11 @pytest.mark.parametrize("key, record, meta, policy, ex_code, ex_msg", [ - (('test', 'demo', 1), {'name': 'john'}, + (('test', 'demo', 1), {'name': 'john'}, {'gen': "wrong", 'ttl': 25000}, {'timeout': 1000}, #Gen as string -2, "Generation should be an int or long"), - (('test', 'demo', 1), {'name': 'john'}, + (('test', 'demo', 1), {'name': 'john'}, {'gen': 3, 'ttl': "25000"}, {'timeout': 1000}, # ttl as string -2, "TTL should be an int or long"), - (('test', 'demo', 1), {'name': 'john'}, + (('test', 'demo', 1), {'name': 'john'}, {'gen': 3, 'ttl': 25000}, {'timeout': "1000"}, # Timeout as string -2, "timeout is invalid"), (('test', 'demo', 1), {'name': 'john'}, #Policy as string diff --git a/test/new_tests/test_remove.py b/test/new_tests/test_remove.py index e85d194ab..63212df78 100644 --- a/test/new_tests/test_remove.py +++ b/test/new_tests/test_remove.py @@ -266,14 +266,14 @@ def test_neg_remove_with_policy_gen_GT_lesser(self, put_data): 'timeout': 1000, 'retry': aerospike.POLICY_RETRY_ONCE, 'key': aerospike.POLICY_KEY_SEND, - 'gen': aerospike.POLICY_GEN_GT + 'gen': aerospike.POLICY_GEN_GT } - (key, meta) = self.as_connection.exists(key) # Record had GEN = x - lesserGen = meta['gen'] -1 #Compute GEN = x - 1 + (key, meta) = self.as_connection.exists(key) + lesserGen = meta['gen'] - 1 with pytest.raises(e.RecordGenerationError) as exception: - self.as_connection.remove(key, {"gen", lesserGen}, policy) + self.as_connection.remove(key, ("gen", lesserGen), policy) (code, msg, _, _) = exception.value assert msg == "AEROSPIKE_ERR_RECORD_GENERATION" assert code == 3 diff --git a/test/new_tests/test_remove_bin.py b/test/new_tests/test_remove_bin.py index 015eba027..60b5606f8 100644 --- a/test/new_tests/test_remove_bin.py +++ b/test/new_tests/test_remove_bin.py @@ -140,9 +140,8 @@ def test_pos_remove_bin_no_bin(self, put_data): key = ('test', 'demo', 1) record = {'name': "jeff", 'age': 45} put_data(self.as_connection, key, record) - self.as_connection.remove_bin(key, []) - try: + self.as_connection.remove_bin(key, []) (key, _, bins) = self.as_connection.get(key) assert bins == record except e.InvalidRequest: