OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/python2.4 |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 |
| 7 """Unittests for grit.format.policy_templates.writers.admx_writer.""" |
| 8 |
| 9 |
| 10 import os |
| 11 import sys |
| 12 import unittest |
| 13 |
| 14 |
| 15 from xml.dom import minidom |
| 16 |
| 17 |
| 18 class XmlWriterBaseTest(unittest.TestCase): |
| 19 '''Base class for XML writer unit-tests. |
| 20 ''' |
| 21 |
| 22 def GetXMLOfChildren(self, parent): |
| 23 '''Returns the XML of all child nodes of the given parent node. |
| 24 Args: |
| 25 parent: The XML of the children of this node will be returned. |
| 26 |
| 27 Return: XML of the chrildren of the parent node. |
| 28 ''' |
| 29 return ''.join( |
| 30 child.toprettyxml(indent=' ') for child in parent.childNodes) |
| 31 |
| 32 def AssertXMLEquals(self, output, expected_output): |
| 33 '''Asserts if the passed XML arguements are equal. |
| 34 Args: |
| 35 output: Actual XML text. |
| 36 expected_output: Expected XML text. |
| 37 ''' |
| 38 self.assertEquals(output.strip(), expected_output.strip()) |
OLD | NEW |