Exemplo n.º 1
0
    def test_read(self):
        '''Read'''
        eq=self.assertEqual
        h=Hosts()
        h.read(self.hostsfile)

        eq(h.keys(), ['localhost.yemen', 'broadcasthost', 'localhost', '127.0.0.1', '255.255.255.255'])
        eq(h['broadcasthost'],'255.255.255.255')
        eq(h['127.0.0.1'],'localhost localhost.yemen')
        eq(h['localhost.yemen'],'127.0.0.1')
        eq(h['localhost'],'127.0.0.1')