tools/bdconfig/lib/google_hadoop/bdconfig_lib/xml_configuration_test.py
def testToPrettyXml(self):
    """Make sure indenting, stripping, and textwrapping works"""
    conf = xml_configuration.Configuration.EmptyConfiguration()
    long_description = textwrap.dedent("""\
    This is a very long multi-line description. This will be split into multiple
    lines by the formatter. I think this should be enough text anyways.""")
    short_description = 'Short Description.\n'
    conf.SetProperty('foo ', '\t bar', description=long_description)
    conf.SetProperty('baz ', ' bat', description=short_description)
    pretty_xml = unicode(textwrap.dedent("""\
    <?xml version="1.0" ?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <configuration>
      <property>
        <name>foo</name>
        <value>bar</value>
        <description>
          This is a very long multi-line description. This will be split into
          multiple lines by the formatter. I think this should be enough text
          anyways.
        </description>
      </property>
      <property>
        <name>baz</name>
        <value>bat</value>
        <description>Short Description.</description>
      </property>
    </configuration>
    """))
    self.assertEqual(pretty_xml, conf.ToPrettyXml())
Make sure indenting, stripping, and textwrapping works
Make sure indenting, stripping, and textwrapping works
Make sure indenting stripping and textwrapping works
def testToPrettyXml(self):
    conf = xml_configuration.Configuration.EmptyConfiguration()
    long_description = textwrap.dedent("""\
    This is a very long multi-line description. This will be split into multiple
    lines by the formatter. I think this should be enough text anyways.""")
    short_description = 'Short Description.\n'
    conf.SetProperty('foo ', '\t bar', description=long_description)
    conf.SetProperty('baz ', ' bat', description=short_description)
    pretty_xml = unicode(textwrap.dedent("""\
    <?xml version="1.0" ?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <configuration>
      <property>
        <name>foo</name>
        <value>bar</value>
        <description>
          This is a very long multi-line description. This will be split into
          multiple lines by the formatter. I think this should be enough text
          anyways.
        </description>
      </property>
      <property>
        <name>baz</name>
        <value>bat</value>
        <description>Short Description.</description>
      </property>
    </configuration>
    """))
    self.assertEqual(pretty_xml, conf.ToPrettyXml())
def testToPrettyXml ( self ) : conf = xml_configuration . Configuration . EmptyConfiguration ( ) long_description = textwrap . dedent ( """\
    This is a very long multi-line description. This will be split into multiple
    lines by the formatter. I think this should be enough text anyways.""" ) short_description = 'Short Description.\n' conf . SetProperty ( 'foo ' , '\t bar' , description = long_description ) conf . SetProperty ( 'baz ' , ' bat' , description = short_description ) pretty_xml = unicode ( textwrap . dedent ( """\
    <?xml version="1.0" ?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <configuration>
      <property>
        <name>foo</name>
        <value>bar</value>
        <description>
          This is a very long multi-line description. This will be split into
          multiple lines by the formatter. I think this should be enough text
          anyways.
        </description>
      </property>
      <property>
        <name>baz</name>
        <value>bat</value>
        <description>Short Description.</description>
      </property>
    </configuration>
    """ ) ) self . assertEqual ( pretty_xml , conf . ToPrettyXml ( ) )
Make sure indenting, stripping, and textwrapping works
Make sure indenting stripping and textwrapping works
"""Make sure indenting, stripping, and textwrapping works"""
self