Skip to content

Commit

Permalink
Fix type comparison error in http
Browse files Browse the repository at this point in the history
  • Loading branch information
VeskeR committed Jan 9, 2025
1 parent f98e3d1 commit ccd33ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ably/http/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def get_rest_hosts(self):
if host is None:
return hosts

if time.time() > self.__host_expires:
# unstore saved fallback host after fallbackRetryTimeout (RSC15f)
if self.__host_expires is not None and time.time() > self.__host_expires:
self.__host = None
self.__host_expires = None
return hosts
Expand Down
7 changes: 7 additions & 0 deletions test/unit/http_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from ably import AblyRest


def test_http_get_rest_hosts_does_not_fail_when_fallback_realtime_host_is_set():
ably = AblyRest(token="foo")
ably.options.fallback_realtime_host = 'fake-host.ably.io'
assert ably.http.get_rest_hosts()

0 comments on commit ccd33ab

Please sign in to comment.