Ejemplo n.º 1
0
def _make_host_resolver():
    """Returns a HostResolver instance

    The hosts file will be empty but accessible as a py.path.local
    instance using the ``hosts`` attribute.
    """
    hosts = tempfile.NamedTemporaryFile()
    hr = greendns.HostsResolver(fname=hosts.name)
    hr.hosts = hosts
    hr._last_stat = 0
    return hr
Ejemplo n.º 2
0
 def test_default_fname(self):
     hr = greendns.HostsResolver()
     assert os.path.exists(hr.fname)