Ejemplo n.º 1
0
 def test6_host_different_from_one_list(self):
     a = DHCPHash(self.new_file)
     b = DHCPHash(self.new_file)
     a_hashed_list = a.get_hash()
     b_hashed_list = b.get_hash()
     self.assertEqual(a_hashed_list, b_hashed_list)
     self.assertEqual(compare_lists(a_hashed_list, b_hashed_list), None)
     self.assertNotEqual(id(a_hashed_list), id(b_hashed_list))
     a_hashed_list[0]['host'] = 'im.fake.yep'
     self.assertNotEqual(compare_lists(a_hashed_list, b_hashed_list), None)
Ejemplo n.º 2
0
 def test7_hardware_ethernet_different_from_one_list(self):
     a = DHCPHash(self.new_file)
     b = DHCPHash(self.new_file)
     a_hashed_list = a.get_hash()
     b_hashed_list = b.get_hash()
     self.assertEqual(a_hashed_list, b_hashed_list)
     self.assertEqual(compare_lists(a_hashed_list, b_hashed_list), None)
     self.assertNotEqual(id(a_hashed_list), id(b_hashed_list))
     a_hashed_list[0]['hardware ethernet'] = '00:00:00:AA:BB:AB'
     self.assertNotEqual(compare_lists(a_hashed_list, b_hashed_list), None)
 def test7_hardware_ethernet_different_from_one_list(self):
     a = DHCPHash(self.new_file)
     b = DHCPHash(self.new_file)
     a_hashed_list = a.get_hash()
     b_hashed_list = b.get_hash()
     self.assertEqual(a_hashed_list, b_hashed_list)
     self.assertEqual(compare_lists(a_hashed_list, b_hashed_list), None)
     self.assertNotEqual(id(a_hashed_list), id(b_hashed_list))
     a_hashed_list[0]['hardware ethernet'] = '00:00:00:AA:BB:AB'
     self.assertNotEqual(compare_lists(a_hashed_list, b_hashed_list), None)
 def test6_host_different_from_one_list(self):
     a = DHCPHash(self.new_file)
     b = DHCPHash(self.new_file)
     a_hashed_list = a.get_hash()
     b_hashed_list = b.get_hash()
     self.assertEqual(a_hashed_list, b_hashed_list)
     self.assertEqual(compare_lists(a_hashed_list, b_hashed_list), None)
     self.assertNotEqual(id(a_hashed_list), id(b_hashed_list))
     a_hashed_list[0]['host'] = 'im.fake.yep'
     self.assertNotEqual(compare_lists(a_hashed_list, b_hashed_list), None)
Ejemplo n.º 5
0
    def test8_extra_option_in_one_list_different_from_one_list(self):
        a = DHCPHash(self.new_file)
        b = DHCPHash(self.new_file)
        a_hashed_list = a.get_hash()
        b_hashed_list = b.get_hash()

        self.assertEqual(a_hashed_list, b_hashed_list)
        self.assertEqual(compare_lists(a_hashed_list, b_hashed_list), None)
        self.assertNotEqual(id(a_hashed_list), id(b_hashed_list))
        a_hashed_list[1]['filename'] = 'asdfasfdasdf.tar.gz'
        self.assertNotEqual(compare_lists(a_hashed_list, b_hashed_list), None)
    def test8_extra_option_in_one_list_different_from_one_list(self):
        a = DHCPHash(self.new_file)
        b = DHCPHash(self.new_file)
        a_hashed_list = a.get_hash()
        b_hashed_list = b.get_hash()

        self.assertEqual(a_hashed_list, b_hashed_list)
        self.assertEqual(compare_lists(a_hashed_list, b_hashed_list), None)
        self.assertNotEqual(id(a_hashed_list), id(b_hashed_list))
        a_hashed_list[1]['filename'] = 'asdfasfdasdf.tar.gz'
        self.assertNotEqual(compare_lists(a_hashed_list, b_hashed_list), None)
Ejemplo n.º 7
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)