mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
test: Fix char encoding issues on windows
Some tests were failing due to Windows not using utf-8 by default when executing the tests. Enforcing usage of utf-8 resolves these issues. Signed-off-by: Daniel Kutik <daniel.kutik@lavawerk.com> Change-Id: If42f6be2a2b688a6105ecf4fcdb541aade24519a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/353179 Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
0297f8312c
commit
003684b6e5
@ -117,7 +117,7 @@ class ManifestParseTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def getXmlManifest(self, data):
|
def getXmlManifest(self, data):
|
||||||
"""Helper to initialize a manifest for testing."""
|
"""Helper to initialize a manifest for testing."""
|
||||||
with open(self.manifest_file, 'w') as fp:
|
with open(self.manifest_file, 'w', encoding="utf-8") as fp:
|
||||||
fp.write(data)
|
fp.write(data)
|
||||||
return manifest_xml.XmlManifest(self.repodir, self.manifest_file)
|
return manifest_xml.XmlManifest(self.repodir, self.manifest_file)
|
||||||
|
|
||||||
@ -428,7 +428,7 @@ class IncludeElementTests(ManifestParseTestCase):
|
|||||||
def parse(name):
|
def parse(name):
|
||||||
name = self.encodeXmlAttr(name)
|
name = self.encodeXmlAttr(name)
|
||||||
# Setup target of the include.
|
# Setup target of the include.
|
||||||
with open(os.path.join(self.manifest_dir, 'target.xml'), 'w') as fp:
|
with open(os.path.join(self.manifest_dir, 'target.xml'), 'w', encoding="utf-8") as fp:
|
||||||
fp.write(f'<manifest><include name="{name}"/></manifest>')
|
fp.write(f'<manifest><include name="{name}"/></manifest>')
|
||||||
|
|
||||||
manifest = self.getXmlManifest("""
|
manifest = self.getXmlManifest("""
|
||||||
|
Loading…
Reference in New Issue
Block a user