Skip to content

Commit ba268cc

Browse files
ivandaschisapego
authored andcommitted
IGNITE-14154 Remove unnecessary test, remove duplicates
This closes #15
1 parent 2ead7b9 commit ba268cc

3 files changed

Lines changed: 5 additions & 33 deletions

File tree

pyignite/queries/response.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import ctypes
2020

2121
from pyignite.constants import RHF_TOPOLOGY_CHANGED, RHF_ERROR
22-
from pyignite.connection import Connection
2322
from pyignite.datatypes import AnyDataObject, Bool, Int, Long, String, StringArray, Struct
2423
from pyignite.queries.op_codes import OP_SUCCESS
2524
from pyignite.stream import READ_BACKWARD
@@ -30,6 +29,7 @@ class Response:
3029
following = attr.ib(type=list, factory=list)
3130
protocol_version = attr.ib(type=tuple, factory=tuple)
3231
_response_header = None
32+
_response_class_name = 'Response'
3333

3434
def __attrs_post_init__(self):
3535
# replace None with empty list
@@ -88,19 +88,16 @@ def parse(self, stream):
8888
else:
8989
self._parse_success(stream, fields)
9090

91-
response_class = self._create_response_class(stream, header_class, fields)
92-
stream.seek(init_pos + ctypes.sizeof(response_class))
93-
return self._create_response_class(stream, header_class, fields)
94-
95-
def _create_response_class(self, stream, header_class, fields: list):
9691
response_class = type(
97-
'Response',
92+
self._response_class_name,
9893
(header_class,),
9994
{
10095
'_pack_': 1,
10196
'_fields_': fields,
10297
}
10398
)
99+
100+
stream.seek(init_pos + ctypes.sizeof(response_class))
104101
return response_class
105102

106103
def _parse_success(self, stream, fields: list):
@@ -130,6 +127,7 @@ class SQLResponse(Response):
130127
"""
131128
include_field_names = attr.ib(type=bool, default=False)
132129
has_cursor = attr.ib(type=bool, default=False)
130+
_response_class_name = 'SQLResponse'
133131

134132
def fields_or_field_count(self):
135133
if self.include_field_names:
@@ -182,17 +180,6 @@ def _parse_success(self, stream, fields: list):
182180
('more', ctypes.c_byte),
183181
]
184182

185-
def _create_response_class(self, stream, header_class, fields: list):
186-
final_class = type(
187-
'SQLResponse',
188-
(header_class,),
189-
{
190-
'_pack_': 1,
191-
'_fields_': fields,
192-
}
193-
)
194-
return final_class
195-
196183
def to_python(self, ctype_object, *args, **kwargs):
197184
if getattr(ctype_object, 'status_code', 0) == 0:
198185
result = {

tests/config/ignite-config.xml.jinja2

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,6 @@
8181
</bean>
8282
</property>
8383

84-
<property name="cacheConfiguration">
85-
<list>
86-
<bean class="org.apache.ignite.configuration.CacheConfiguration">
87-
<property name="name" value="custom-affinity"/>
88-
<property name="affinity">
89-
<bean class="org.apache.ignite.internal.processors.affinity.LocalAffinityFunction"/>
90-
</property>
91-
</bean>
92-
</list>
93-
</property>
94-
9584
<property name="gridLogger">
9685
<bean class="org.apache.ignite.logger.log4j2.Log4J2Logger">
9786
<constructor-arg type="java.lang.String" value="config/log4j-{{ ignite_instance_idx }}.xml"/>

tests/test_affinity_request_routing.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,6 @@ def test_cache_operation_routed_to_new_cluster_node(request, start_ignite_server
184184
kill_process_tree(srv.pid)
185185

186186

187-
def test_unsupported_affinity_cache_operation_routed_to_random_node(client_partition_aware):
188-
verify_random_node(client_partition_aware.get_cache("custom-affinity"))
189-
190-
191187
def test_replicated_cache_operation_routed_to_random_node(request, client_partition_aware):
192188
cache = client_partition_aware.get_or_create_cache({
193189
PROP_NAME: request.node.name,

0 commit comments

Comments
 (0)