<s> from test . util import build_grab <EOL> from test . util import BaseGrabTestCase <EOL> class GrabXMLProcessingTestCase ( BaseGrabTestCase ) : <EOL> def setUp ( self ) : <EOL> self . server . reset ( ) <EOL> def test_xml_with_declaration ( self ) : <EOL> self . server . response [ '<STR_LIT>' ] = b'<STR_LIT>' b'<STR_LIT>' <EOL> g = build_grab ( ) <EOL> g . go ( self . server . get_url ( ) ) <EOL> self . assertTrue ( g . xpath_one ( '<STR_LIT>' ) . text == '<STR_LIT:foo>' ) <EOL> def test_declaration_bug ( self ) : <EOL> """<STR_LIT>""" <EOL> xml = b'<STR_LIT>' b'<STR_LIT>' <EOL> g = build_grab ( document_body = xml ) <EOL> self . assertTrue ( g . search ( u'<STR_LIT:text>' ) ) <EOL> self . assertEqual ( g . xpath_one ( '<STR_LIT>' ) . text , u'<STR_LIT:text>' ) <EOL> g = build_grab ( document_body = xml ) <EOL> self . assertTrue ( g . rex ( u'<STR_LIT:text>' ) ) <EOL> self . assertEqual ( g . xpath_one ( '<STR_LIT>' ) . text , u'<STR_LIT:text>' ) </s>
