Skip to content

Commit dede881

Browse files
committed
unit test fix
1 parent 4c75e10 commit dede881

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

aws_advanced_python_wrapper/fastest_response_strategy_plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def get_host_info_by_strategy(self, role: HostRole, strategy: str) -> HostInfo:
141141
calculated_fastest_response_host,
142142
self._cache_expiration_nanos)
143143

144-
self._host_response_time_service.get_response_time(calculated_fastest_response_host)
145144
return calculated_fastest_response_host
146145

147146
def notify_host_list_changed(self, changes: Dict[str, Set[HostEvent]]):

tests/unit/test_fastest_response_strategy_plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ def test_notify_host_list_changed(
132132

133133

134134
def test_get_host_info_by_strategy_calculated_host(plugin, reader_host2, mock_host_response_time_service):
135-
mock_host_response_time_service.get_response_time.side_effect = [MAX_VALUE, 4000, 5000]
135+
mock_host_response_time_service.get_response_time.side_effect = [MAX_VALUE, 4000, 5000, 4000]
136136

137137
# calculated host
138-
result_host = plugin.get_host_info_by_strategy(HostRole.READER, "fastest_response_strategy")
138+
result_host = plugin.get_host_info_by_strategy(HostRole.READER, "fastest_response")
139139
assert result_host.host == reader_host2.host
140140

141141
# cached host
142-
result_host = plugin.get_host_info_by_strategy(HostRole.READER, "fastest_response_strategy")
142+
result_host = plugin.get_host_info_by_strategy(HostRole.READER, "fastest_response")
143143
assert result_host.host == reader_host2.host
144144

145145

0 commit comments

Comments
 (0)