TestNet

class tests.test_net.TestNet(methodName='runTest')[source]

Test cases related to privex.helpers.net or generally network related functions

__init__(methodName='runTest')

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Methods

Methods

test_asn_to_name_erroneous()

Test asn_to_name returns ‘Unknown ASN’ when quiet, otherwise throws a KeyError for ASN ‘nonexistent’

test_asn_to_name_erroneous_2()

Test asn_to_name returns ‘Unknown ASN’ when quiet, otherwise throws KeyError for the ASN 999999999

test_asn_to_name_int()

Test Privex’s ASN (as an int) 210083 resolves to ‘PRIVEX, SE’

test_asn_to_name_str()

Test Cloudflare’s ASN (as a str) ‘13335’ resolves to ‘CLOUDFLARENET - Cloudflare, Inc., US’

test_get_rdns_invalid_domain()

Test get_rdns() raises InvalidHost when given a non-existent domain

test_get_rdns_multi()

Test get_rdns_multi() with 3x IPv4 addresses and 1x IPv6 address

test_get_rdns_multi_invalid()

Test get_rdns_multi() with 2x IPv4 addresses + 2x IPv6 addresses with one of each having no records

test_get_rdns_no_rdns_records()

Test get_rdns() raises ReverseDNSNotFound when given a valid IP that has no rDNS records

test_get_rdns_privex_ns1_host()

Test resolving rDNS for the domains steemseed-fin.privex.io and ns1.privex.io

test_get_rdns_privex_ns1_ip()

Test resolving IPv4 and IPv6 addresses into ns1.privex.io

test_ping()

Test success & failure cases for ping function with IPv4, as well as input validation

test_ping_v6()

Test success & failure cases for ping function with IPv6, as well as input validation

Attributes

Attributes