Skip to content

Commit

Permalink
add more case to tests for proxies' sources
Browse files Browse the repository at this point in the history
  • Loading branch information
ludndev committed Mar 23, 2024
1 parent c1dd670 commit 07c3d84
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_proxy_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ def setUp(self):
self.proxies = {}

def test_get_proxies_from_all_sources(self):
sources_classes = sources.get_sources(auth=None)
self.fetch_and_assert_proxies(sources_classes)

def test_get_proxies_with_auth_true(self):
sources_classes = sources.get_sources(auth=True)
self.fetch_and_assert_proxies(sources_classes)

def test_get_proxies_with_auth_false(self):
sources_classes = sources.get_sources(auth=False)
self.fetch_and_assert_proxies(sources_classes)

def fetch_and_assert_proxies(self, sources_classes):
for source_class in sources_classes:
source_instance = source_class()
if source_class.__name__ not in self.proxies:
Expand Down

0 comments on commit 07c3d84

Please sign in to comment.