<s> import unittest , sys <EOL> from lxml . tests . common_imports import make_doctest , doctest <EOL> import lxml . html <EOL> from lxml . html import html_parser , XHTML_NAMESPACE <EOL> class FrameTest ( unittest . TestCase ) : <EOL> def test_parse_fragments_fromstring ( self ) : <EOL> parser = lxml . html . HTMLParser ( encoding = '<STR_LIT:utf-8>' , remove_comments = True ) <EOL> html = """<STR_LIT>""" <EOL> etree_document = lxml . html . fragments_fromstring ( html , parser = parser ) <EOL> self . assertEqual ( len ( etree_document ) , <NUM_LIT:1> ) <EOL> root = etree_document [ <NUM_LIT:0> ] <EOL> self . assertEqual ( root . tag , "<STR_LIT>" ) <EOL> frame_element = root [ <NUM_LIT:0> ] <EOL> self . assertEqual ( frame_element . tag , '<STR_LIT>' ) <EOL> def test_parse_fromstring ( self ) : <EOL> parser = lxml . html . HTMLParser ( encoding = '<STR_LIT:utf-8>' , remove_comments = True ) <EOL> html = """<STR_LIT>""" <EOL> etree_document = lxml . html . fromstring ( html , parser = parser ) <EOL> self . assertEqual ( etree_document . tag , '<STR_LIT:html>' ) <EOL> self . assertEqual ( len ( etree_document ) , <NUM_LIT:1> ) <EOL> frameset_element = etree_document [ <NUM_LIT:0> ] <EOL> self . assertEqual ( len ( frameset_element ) , <NUM_LIT:1> ) <EOL> frame_element = frameset_element [ <NUM_LIT:0> ] <EOL> self . assertEqual ( frame_element . tag , '<STR_LIT>' ) <EOL> def test_suite ( ) : <EOL> loader = unittest . TestLoader ( ) <EOL> return loader . loadTestsFromModule ( sys . modules [ __name__ ] ) </s>
