From 6e48663230ed9449f828b438f370a82072f5fcf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20P=C3=B6hn?= Date: Thu, 11 Jul 2019 03:18:30 +0200 Subject: [PATCH] test that write yaml does not write provides --- tests/metadata.TestCase | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/metadata.TestCase b/tests/metadata.TestCase index d669c567..68e402ab 100755 --- a/tests/metadata.TestCase +++ b/tests/metadata.TestCase @@ -539,6 +539,34 @@ class MetadataTest(unittest.TestCase): UpdateCheckMode: None """)) + def test_write_yaml_make_sure_provides_does_not_get_written(self): + mf = io.StringIO() + app = fdroidserver.metadata.App() + app.Categories = ['None'] + app.Provides = 'this.is.deprecated' + app.builds = [] + build = fdroidserver.metadata.Build() + build.versionCode = 102030 + build.versionName = 'v1.2.3' + build.gradle = ['yes'] + app.builds.append(build) + fdroidserver.metadata.write_yaml(mf, app) + mf.seek(0) + self.assertEqual(mf.read(), textwrap.dedent("""\ + Categories: + - None + License: Unknown + + Builds: + - versionName: v1.2.3 + versionCode: 102030 + gradle: + - yes + + AutoUpdateMode: None + UpdateCheckMode: None + """)) + if __name__ == "__main__": os.chdir(os.path.dirname(__file__))