File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 1212 import unittest
1313
1414from algoliasearch .client import Client , MAX_API_KEY_LENGTH
15+ from algoliasearch .helpers import AlgoliaException
1516
1617from .helpers import safe_index_name
1718from .helpers import get_api_client
@@ -123,20 +124,16 @@ def user_name(self):
123124 def test_dns_timeout (self ):
124125 app_id = os .environ ['ALGOLIA_APPLICATION_ID' ]
125126
126- hosts = [
127- '%s-dsn.algolia.biz' % app_id ,
128- '%s-dsn.algolia.net' % app_id ,
129- '%s-1.algolianet.com' % app_id ,
130- '%s-2.algolianet.com' % app_id ,
131- '%s-3.algolianet.com' % app_id ,
132- ]
133-
127+ hosts = ['algolia.biz' ]
134128 client = Client (app_id , os .environ ['ALGOLIA_API_KEY' ], hosts )
135129 client .set_timeout (5 , 2 )
136130
137131 now = time .time ()
138- indices = client .list_indexes ()
139- self .assertLess (now + 5 , time .time ())
132+ try :
133+ indices = client .list_indexes ()
134+ except AlgoliaException :
135+ pass
136+ self .assertLess (time .time (), now + 6 )
140137
141138
142139class ClientWithDataTest (ClientTest ):
You can’t perform that action at this time.
0 commit comments