tests/test_webtracker.py
def mock_dns_resolver(domain, qtype):
        """
        A mock DNS resolver, which either return anything normally or raise dns.resolver.NXDOMAIN exception.
        For tests, it returns as follows.

        notexistingdns.com --> Exception dns.resolver.NXDOMAIN case
        Anything else --> '8.8.8.8'

        :param domain: Domain name
        :param qtype: query string, ignored.
        :return:
        """
        if domain == 'notexistingdns.com':
            raise dns.resolver.NXDOMAIN()
        else:
            return '8.8.8.8'

        A mock DNS resolver, which either return anything normally or raise dns.resolver.NXDOMAIN exception.
        For tests, it returns as follows.

        notexistingdns.com --> Exception dns.resolver.NXDOMAIN case
        Anything else --> '8.8.8.8'

        :param domain: Domain name
        :param qtype: query string, ignored.
        :return:
        
A mock DNS resolver, which either return anything normally or raise dns.resolver.NXDOMAIN exception.
For tests, it returns as follows.


A mock DNS resolver which either return anything normally or raise dns . resolver . NXDOMAIN exception . For tests it returns as follows .
def mock_dns_resolver(domain, qtype):
        if domain == 'notexistingdns.com':
            raise dns.resolver.NXDOMAIN()
        else:
            return '8.8.8.8'
def mock_dns_resolver ( domain , qtype ) : if domain == 'notexistingdns.com' : raise dns . resolver . NXDOMAIN ( ) else : return '8.8.8.8'
A mock DNS resolver, which either return anything normally or raise dns.resolver.NXDOMAIN exception.
A mock DNS resolver which either return anything normally or raise dns . resolver . NXDOMAIN exception .
"""
        A mock DNS resolver, which either return anything normally or raise dns.resolver.NXDOMAIN exception.
        For tests, it returns as follows.

        notexistingdns.com --> Exception dns.resolver.NXDOMAIN case
        Anything else --> '8.8.8.8'

        :param domain: Domain name
        :param qtype: query string, ignored.
        :return:
        """
None
domain
None
qtype
query string, ignored.
query string ignored .