From e64f121c0c4011bf98ecd05e4209b0bf0be08120 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 24 May 2023 21:44:36 +0200 Subject: [PATCH] metadata: type conversion happens at parsing, not at writing These test cases were writing assuming they had to transform the data format. That is no longer the case. Going forward, the parsing process converts everything to a standardized format. That will hopefully be enforceable by the JSON Schema in the future. --- tests/metadata.TestCase | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/metadata.TestCase b/tests/metadata.TestCase index fd15c5e7..343d2b1c 100755 --- a/tests/metadata.TestCase +++ b/tests/metadata.TestCase @@ -720,7 +720,7 @@ class MetadataTest(unittest.TestCase): build.versionCode = '0' # taken from fdroidserver/import.py build.disable = 'Generated by import.py ...' build.commit = 'Unknown' - build.gradle = [True] + build.gradle = ['yes'] app['Builds'] = [build] fdroidserver.metadata.write_yaml(mf, app) @@ -745,7 +745,7 @@ class MetadataTest(unittest.TestCase): disable: Generated by import.py ... commit: Unknown gradle: - - true + - yes AutoUpdateMode: None UpdateCheckMode: Tags @@ -1886,10 +1886,6 @@ class MetadataTest(unittest.TestCase): app = metadata.App({'Builds': [metadata.Build({'rm': []})]}) self.assertEqual(dict(), metadata._app_to_yaml(app)['Builds'][0]) - def test_app_to_yaml_build_list_string(self): - app = metadata.App({'Builds': [metadata.Build({'rm': 'one'})]}) - self.assertEqual({'rm': 'one'}, metadata._app_to_yaml(app)['Builds'][0]) - def test_app_to_yaml_build_list_one(self): app = metadata.App({'Builds': [metadata.Build({'rm': ['one']})]}) self.assertEqual({'rm': ['one']}, metadata._app_to_yaml(app)['Builds'][0])