Ejemplo n.º 1
0
 def test5_host_missing_from_one_list(self):
     d = DHCPHash(self.new_file)
     unformatted = d.remove_formatting(d.list_string)
     the_list = d.split_lines(unformatted)
     hashed_list = d.hash_list(the_list)
     second_hash = list(hashed_list)
     self.assertEqual(hashed_list, second_hash)
     second_hash.pop()
     self.assertNotEqual(hashed_list, second_hash)
     resp = compare_lists(hashed_list, second_hash)
     self.assertNotEqual(resp, None)
 def test5_host_missing_from_one_list(self):
     d = DHCPHash(self.new_file)
     unformatted = d.remove_formatting(d.list_string)
     the_list = d.split_lines(unformatted)
     hashed_list = d.hash_list(the_list)
     second_hash = list(hashed_list)
     self.assertEqual(hashed_list, second_hash)
     second_hash.pop()
     self.assertNotEqual(hashed_list, second_hash)
     resp = compare_lists(hashed_list, second_hash)
     self.assertNotEqual(resp, None)
Ejemplo n.º 3
0
 def test4_create_hash(self):
     d = DHCPHash(self.new_file)
     unformatted = d.remove_formatting(d.list_string)
     the_list = d.split_lines(unformatted)
     hashed_list = d.hash_list(the_list)
     self.assertEqual(hashed_list[0]['host'], 'foofake1.db.phx1.mozilla.com')
     self.assertEqual(hashed_list[0]['hardware ethernet'], 'AA:BB:46:83:BA:F0')
     self.assertEqual(hashed_list[0]['fixed-address'], '10.99.99.11')
     self.assertEqual(hashed_list[0]['option domain-name'], 'mozilla.com')
     self.assertEqual(hashed_list[0]['option host-name'], 'foofake1.db.phx1.mozilla.com')
     self.assertEqual(hashed_list[0]['option domain-name-servers'], '10.0.0.1,10.0.0.2')
 def test4_create_hash(self):
     d = DHCPHash(self.new_file)
     unformatted = d.remove_formatting(d.list_string)
     the_list = d.split_lines(unformatted)
     hashed_list = d.hash_list(the_list)
     self.assertEqual(hashed_list[0]['host'],
                      'foofake1.db.phx1.mozilla.com')
     self.assertEqual(hashed_list[0]['hardware ethernet'],
                      'AA:BB:46:83:BA:F0')
     self.assertEqual(hashed_list[0]['fixed-address'], '10.99.99.11')
     self.assertEqual(hashed_list[0]['option domain-name'], 'mozilla.com')
     self.assertEqual(hashed_list[0]['option host-name'],
                      'foofake1.db.phx1.mozilla.com')
     self.assertEqual(hashed_list[0]['option domain-name-servers'],
                      '10.0.0.1,10.0.0.2')