Convert soong scripts to python 3

Except manifest_utils, which is used by
apexer.

Tests run:
m construct_context_test manifest_check_test manifest_fixer_test test_config_fixer_test
out/host/linux-x86/testcases/construct_context_test/x86_64/construct_context_test
out/host/linux-x86/testcases/manifest_check_test/x86_64/manifest_check_test
out/host/linux-x86/testcases/manifest_fixer_test/x86_64/manifest_fixer_test
out/host/linux-x86/testcases/test_config_fixer_test/x86_64/test_config_fixer_test

Bug: 203436762
Test: Tests listed above + presubmits
Change-Id: Ife75b3af1efc871a2d8521d26153a262573bb706
This commit is contained in:
Cole Faust
2021-11-09 15:08:26 -08:00
parent 76b0c499d0
commit c41dd72d3b
7 changed files with 78 additions and 141 deletions

View File

@@ -16,7 +16,7 @@
#
"""Unit tests for test_config_fixer.py."""
import StringIO
import io
import sys
import unittest
from xml.dom import minidom
@@ -59,7 +59,7 @@ class OverwritePackageNameTest(unittest.TestCase):
manifest = minidom.parseString(self.manifest)
test_config_fixer.overwrite_package_name(doc, manifest, "com.soong.foo")
output = StringIO.StringIO()
output = io.StringIO()
test_config_fixer.write_xml(output, doc)
# Only the matching package name in a test node should be updated.
@@ -86,7 +86,7 @@ class OverwriteTestFileNameTest(unittest.TestCase):
doc = minidom.parseString(self.test_config % ("foo.apk"))
test_config_fixer.overwrite_test_file_name(doc, "bar.apk")
output = StringIO.StringIO()
output = io.StringIO()
test_config_fixer.write_xml(output, doc)
# Only the matching package name in a test node should be updated.