コード例 #1
0
ファイル: test_utils.py プロジェクト: balagopalraj/clearlinux
    def test_clean_up_xml(self):
        # Make sure the whitespace at the end of a self-closing tag is removed.
        bad_xml = '''
<root>
    <selfclosingtag />
</root>'''
        good_xml = '''
<root>
    <selfclosingtag/>
</root>'''
        self.assertEqual(clean_up_xml(bad_xml), good_xml)
        self.assertEqual(clean_up_xml(good_xml), good_xml)
コード例 #2
0
ファイル: test_utils.py プロジェクト: balagopalraj/clearlinux
 def test_clean_up_xml_encoding(self):
     # Make sure the right encoding is added.
     self.assertEqual(
         clean_up_xml('<?xml version="1.0"?>'),
         '<?xml version="1.0" encoding="UTF-8"?>'
     )