Skip to content

Commit

Permalink
Issue #24: Infinite loop getting proxy if no proxies available (fixed…
Browse files Browse the repository at this point in the history
… tests).
  • Loading branch information
Nekmo committed Nov 9, 2020
1 parent 544ae3b commit 88dfa1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class TestNoProviderInfiniteLoop(unittest.TestCase):

@patch("proxy_db.proxies.ProxiesList.reload_provider")
@patch("proxy_db.proxies.ProxiesList.find_db_proxy")
def test_infinite_recursion_loop_solution(self, reload_provider_mock, find_db_proxy_mock):
def test_infinite_recursion_loop_solution(self, find_db_proxy_mock, reload_provider_mock):
"""This call was falling into a recursion loop. Now tries only twice and then raise
an StopIteration exception."""
from proxy_db.proxies import ProxiesList
Expand All @@ -286,4 +286,4 @@ def test_infinite_recursion_loop_solution(self, reload_provider_mock, find_db_pr

self.assertRaises(StopIteration, lambda: next(ProxiesList("country")))
self.assertEqual(find_db_proxy_mock.call_count, 2)
self.assertEqual(reload_provider_mock.call_count, 2)
self.assertEqual(reload_provider_mock.call_count, 1)

0 comments on commit 88dfa1e

Please sign in to comment.