

def test_encoding_detection(self):
    doc = xml_document(b'<foo>bar</foo>')
    self.assertEqual(doc.encoding, 'UTF-8')
    doc = xml_document(b"<?xml version='1.0' encoding='BIG5'?><foo>bar</foo>")
    self.assertEqual(doc.encoding, 'BIG5')

dataset/ETHPy150Open jdswinbank/Comet/comet/utility/test/test_xml.py xml_document_encoding.test_encoding_detection/original