1import augeas 2 3a = augeas.Augeas(root="/") 4hosts = a.match("/files/etc/hosts/*") 5assert(hosts is not None) 6assert(len(hosts) == 2) 7 8assert(a.get("/files/etc/hosts/1/ipaddr") == "127.0.0.1") 9assert(a.get("/files/etc/hosts/1/canonical") == "localhost") 10