tools/metrics/actions/extract_actions_test.py
def testSuffixPrettyPrint(self):
    """Tests that suffixes are preserved when pretty-printing."""
    original_xml = """
    <actions>
    <action name="action1">
      <owner>name1@chromium.org</owner>
      <description>Description.</description>
    </action>
    <action name="action2">
      <owner>name1@chromium.org</owner>
      <description>Description.</description>
    </action>
    <action-suffix separator="_">
      <suffix name="suffix1" label="Suffix Description 1." />
      <affected-action name="action2"/>
      <suffix name="suffix2" label="Suffix Description 2."/>
      <affected-action name="action1" />
    </action-suffix>
    </actions>
    """
    xml_result = self._PrettyPrintActionsXML(original_xml)
    expected_pretty_xml = """<actions>

<action name="action1">
  <owner>name1@chromium.org</owner>
  <description>Description.</description>
</action>

<action name="action2">
  <owner>name1@chromium.org</owner>
  <description>Description.</description>
</action>

<action-suffix separator="_">
  <suffix name="suffix1" label="Suffix Description 1."/>
  <suffix name="suffix2" label="Suffix Description 2."/>
  <affected-action name="action1"/>
  <affected-action name="action2"/>
</action-suffix>

</actions>
"""
    self.assertMultiLineEqual(expected_pretty_xml, xml_result)
Tests that suffixes are preserved when pretty-printing.
Tests that suffixes are preserved when pretty-printing.
Tests that suffixes are preserved when pretty - printing .
def testSuffixPrettyPrint(self):
    original_xml = """
    <actions>
    <action name="action1">
      <owner>name1@chromium.org</owner>
      <description>Description.</description>
    </action>
    <action name="action2">
      <owner>name1@chromium.org</owner>
      <description>Description.</description>
    </action>
    <action-suffix separator="_">
      <suffix name="suffix1" label="Suffix Description 1." />
      <affected-action name="action2"/>
      <suffix name="suffix2" label="Suffix Description 2."/>
      <affected-action name="action1" />
    </action-suffix>
    </actions>
    """
    xml_result = self._PrettyPrintActionsXML(original_xml)
    expected_pretty_xml = """<actions>
<action name="action1">
  <owner>name1@chromium.org</owner>
  <description>Description.</description>
</action>
<action name="action2">
  <owner>name1@chromium.org</owner>
  <description>Description.</description>
</action>
<action-suffix separator="_">
  <suffix name="suffix1" label="Suffix Description 1."/>
  <suffix name="suffix2" label="Suffix Description 2."/>
  <affected-action name="action1"/>
  <affected-action name="action2"/>
</action-suffix>
</actions>
"""
    self.assertMultiLineEqual(expected_pretty_xml, xml_result)
def testSuffixPrettyPrint ( self ) : original_xml = """
    <actions>
    <action name="action1">
      <owner>name1@chromium.org</owner>
      <description>Description.</description>
    </action>
    <action name="action2">
      <owner>name1@chromium.org</owner>
      <description>Description.</description>
    </action>
    <action-suffix separator="_">
      <suffix name="suffix1" label="Suffix Description 1." />
      <affected-action name="action2"/>
      <suffix name="suffix2" label="Suffix Description 2."/>
      <affected-action name="action1" />
    </action-suffix>
    </actions>
    """ xml_result = self . _PrettyPrintActionsXML ( original_xml ) expected_pretty_xml = """<actions>

<action name="action1">
  <owner>name1@chromium.org</owner>
  <description>Description.</description>
</action>

<action name="action2">
  <owner>name1@chromium.org</owner>
  <description>Description.</description>
</action>

<action-suffix separator="_">
  <suffix name="suffix1" label="Suffix Description 1."/>
  <suffix name="suffix2" label="Suffix Description 2."/>
  <affected-action name="action1"/>
  <affected-action name="action2"/>
</action-suffix>

</actions>
""" self . assertMultiLineEqual ( expected_pretty_xml , xml_result )
Tests that suffixes are preserved when pretty-printing.
Tests that suffixes are preserved when pretty - printing .
"""Tests that suffixes are preserved when pretty-printing."""
self