def test_wrong_string2(self):
     test_string = '''
     <html></a></html>
     '''
     all_tags = find_all_tags(test_string)
     with self.assertRaises(ValueError):
         new_string = partition_and_replace(test_string, all_tags)
 def test_standard_string2(self):
     test_string = '''
     <img src="www.example.com" />
     '''
     all_tags = find_all_tags(test_string)
     new_string = partition_and_replace(test_string, all_tags)
     self.assertEqual(test_string, new_string)
 def test_standard_string(self):
     test_string = '''
     <html>
       <head>
       </head>
       <body>
       </body>
     </html>
     '''
     all_tags = find_all_tags(test_string)
     new_string = partition_and_replace(test_string, all_tags)
     self.assertEqual(test_string, new_string)
 def test_nested_non_standard_string(self):
     test_string = '''
     <html>
       <head></>
     </>
     '''
     expected_new_string = '''
     <html>
       <head></head>
     </html>
     '''
     all_tags = find_all_tags(test_string)
     new_string = partition_and_replace(test_string, all_tags)
     self.assertEqual(new_string, expected_new_string)