TestNet

class tests.test_net.TestNet(*args, **kwargs)[source]

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

__init__(*args, **kwargs)[source]

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_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