tests package

Submodules

tests.test_countries module

class tests.test_countries.TestExtractFileTo(methodName='runTest')

Bases: unittest.case.TestCase

test_extract_file_to(open_mock)
class tests.test_countries.TestIpCountry(methodName='runTest')

Bases: unittest.case.TestCase

test_ip_country(m)

tests.test_models module

class tests.test_models.TestProxy(methodName='runTest')

Bases: unittest.case.TestCase

proxy_id = '1.1.1.1:8888'
test_copy()
test_get()
test_get_default()
test_in()
test_str()
test_vote(m)

tests.test_providers module

Tests for proxy-db package.

class tests.test_providers.TestNoProviderInfiniteLoop(methodName='runTest')

Bases: unittest.case.TestCase

Test to make sure that it doesn’t fall into an infinite loop when next(ProxiesList(country)) is called with a country with no proxies.

test_infinite_recursion_loop_solution(reload_provider_mock, find_db_proxy_mock)

This call was falling into a recursion loop. Now tries only twice and then raise an StopIteration exception.

class tests.test_providers.TestProvider(methodName='runTest')

Bases: unittest.case.TestCase

proxies = [{'proxy': ('12.131.91.51', '8888')}, {'proxy': ('8.10.81.82', '7171')}]
test_find_page_proxies()
test_process_proxies(mock_session)
test_request()
url = 'https://domain.com/'
class tests.test_providers.TestProviderRequestBase(methodName='runTest')

Bases: unittest.case.TestCase

get_provider()
get_provider_request()
test_get_or_create()
test_id()
test_now(m2, m1)
test_requires_update()
test_requires_update_not_exists()
url = 'https://domain.com/'
class tests.test_providers.TestProxyNovaCom(methodName='runTest')

Bases: unittest.case.TestCase

test_find_page_proxies()
test_invalid_rows(m)
test_request(m)
test_request_country(m)
url = 'https://domain.com/'

tests.test_utils module

class tests.test_utils.TestDownloadFile(methodName='runTest')

Bases: unittest.case.TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_request(m)
url = 'https://domain.com/'
class tests.test_utils.TestGetDomain(methodName='runTest')

Bases: unittest.case.TestCase

test_get_domain()

Module contents

Unit test package for proxy_db.