2727from pyignite .datatypes .prop_codes import *
2828
2929
30- def test_get_node_partitions (client_partition_aware ):
30+ def test_get_node_partitions (client ):
31+ conn = client .random_node
3132
32- conn = client_partition_aware .random_node
33-
34- cache_1 = client_partition_aware .get_or_create_cache ('test_cache_1' )
35- cache_2 = client_partition_aware .get_or_create_cache ({
33+ cache_1 = client .get_or_create_cache ('test_cache_1' )
34+ cache_2 = client .get_or_create_cache ({
3635 PROP_NAME : 'test_cache_2' ,
3736 PROP_CACHE_KEY_CONFIGURATION : [
3837 {
@@ -41,9 +40,9 @@ def test_get_node_partitions(client_partition_aware):
4140 }
4241 ],
4342 })
44- cache_3 = client_partition_aware .get_or_create_cache ('test_cache_3' )
45- cache_4 = client_partition_aware .get_or_create_cache ('test_cache_4' )
46- cache_5 = client_partition_aware .get_or_create_cache ('test_cache_5' )
43+ client .get_or_create_cache ('test_cache_3' )
44+ client .get_or_create_cache ('test_cache_4' )
45+ client .get_or_create_cache ('test_cache_5' )
4746
4847 result = cache_get_node_partitions (
4948 conn ,
@@ -115,9 +114,8 @@ def test_get_node_partitions(client_partition_aware):
115114
116115 ],
117116)
118- def test_affinity (client_partition_aware , key , key_hint ):
119-
120- cache_1 = client_partition_aware .get_or_create_cache ({
117+ def test_affinity (client , key , key_hint ):
118+ cache_1 = client .get_or_create_cache ({
121119 PROP_NAME : 'test_cache_1' ,
122120 PROP_CACHE_MODE : CacheMode .PARTITIONED ,
123121 })
@@ -126,7 +124,7 @@ def test_affinity(client_partition_aware, key, key_hint):
126124
127125 best_node = cache_1 .get_best_node (key , key_hint = key_hint )
128126
129- for node in filter (lambda n : n .alive , client_partition_aware ._nodes ):
127+ for node in filter (lambda n : n .alive , client ._nodes ):
130128 result = cache_local_peek (
131129 node , cache_1 .cache_id , key , key_hint = key_hint ,
132130 )
@@ -142,9 +140,8 @@ def test_affinity(client_partition_aware, key, key_hint):
142140 cache_1 .destroy ()
143141
144142
145- def test_affinity_for_generic_object (client_partition_aware ):
146-
147- cache_1 = client_partition_aware .get_or_create_cache ({
143+ def test_affinity_for_generic_object (client ):
144+ cache_1 = client .get_or_create_cache ({
148145 PROP_NAME : 'test_cache_1' ,
149146 PROP_CACHE_MODE : CacheMode .PARTITIONED ,
150147 })
@@ -166,7 +163,7 @@ class KeyClass(
166163
167164 best_node = cache_1 .get_best_node (key , key_hint = BinaryObject )
168165
169- for node in filter (lambda n : n .alive , client_partition_aware ._nodes ):
166+ for node in filter (lambda n : n .alive , client ._nodes ):
170167 result = cache_local_peek (
171168 node , cache_1 .cache_id , key , key_hint = BinaryObject ,
172169 )
@@ -182,16 +179,8 @@ class KeyClass(
182179 cache_1 .destroy ()
183180
184181
185- def test_affinity_for_generic_object_without_type_hints (client_partition_aware ):
186-
187- if not client_partition_aware .partition_awareness_supported_by_protocol :
188- pytest .skip (
189- 'Best effort affinity is not supported by the protocol {}.' .format (
190- client_partition_aware .protocol_version
191- )
192- )
193-
194- cache_1 = client_partition_aware .get_or_create_cache ({
182+ def test_affinity_for_generic_object_without_type_hints (client ):
183+ cache_1 = client .get_or_create_cache ({
195184 PROP_NAME : 'test_cache_1' ,
196185 PROP_CACHE_MODE : CacheMode .PARTITIONED ,
197186 })
@@ -213,7 +202,7 @@ class KeyClass(
213202
214203 best_node = cache_1 .get_best_node (key )
215204
216- for node in filter (lambda n : n .alive , client_partition_aware ._nodes ):
205+ for node in filter (lambda n : n .alive , client ._nodes ):
217206 result = cache_local_peek (
218207 node , cache_1 .cache_id , key
219208 )
0 commit comments