Commit 975e74d6 authored by Michael Pöhn's avatar Michael Pöhn

write yaml: ensure unicode is always working

parent c8e6db00
Pipeline #56636169 passed with stage
in 21 minutes and 53 seconds
......@@ -1144,7 +1144,7 @@ def _format_yml_field(field, value, typ, width=80, offset=0):
else:
data[field] = value
raw_yml = yaml.dump(data, Dumper=yaml.SafeDumper,
raw_yml = yaml.dump(data, Dumper=yaml.SafeDumper, allow_unicode=True,
default_flow_style=False, width=width,
default_style=default_style, indent=4)
......
......@@ -692,6 +692,7 @@ class MetadataTest(unittest.TestCase):
mf = io.StringIO()
app = fdroidserver.metadata.App()
app.Categories = ['None']
app.AuthorName = 'Ümlaut'
app.builds = []
build = fdroidserver.metadata.Build()
build.versionCode = 102030
......@@ -709,10 +710,12 @@ class MetadataTest(unittest.TestCase):
app.builds.append(build)
fdroidserver.metadata.write_yaml(mf, app)
mf.seek(0)
self.maxDiff = None
self.assertEqual(mf.read(), textwrap.dedent("""\
Categories:
- None
License: Unknown
AuthorName: Ümlaut
Builds:
- versionName: v1.2.3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment