mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-03 17:50:11 +02:00
add test for parsing build field prebuild as string
This commit is contained in:
parent
942de28fa5
commit
d0a129c216
@ -209,7 +209,7 @@ class MetadataTest(unittest.TestCase):
|
||||
UpdateCheckMode: Tags
|
||||
"""))
|
||||
|
||||
def test_parse_yaml_metadata_prebuild(self):
|
||||
def test_parse_yaml_metadata_prebuild_list(self):
|
||||
mf = io.StringIO(textwrap.dedent("""\
|
||||
AutoName: F-Droid
|
||||
RepoType: git
|
||||
@ -232,6 +232,28 @@ class MetadataTest(unittest.TestCase):
|
||||
'versionName': 'v0.1.0',
|
||||
'prebuild': 'a && b && c'}]})
|
||||
|
||||
def test_parse_yaml_metadata_prebuild_string(self):
|
||||
mf = io.StringIO(textwrap.dedent("""\
|
||||
AutoName: F-Droid
|
||||
RepoType: git
|
||||
Builds:
|
||||
- versionCode: 1
|
||||
versionName: v0.1.0
|
||||
prebuild: |-
|
||||
a && b && sed -i 's,a,b,'
|
||||
"""))
|
||||
mf.name = 'mock_filename.yaml'
|
||||
mf.seek(0)
|
||||
result = {}
|
||||
with mock.patch('fdroidserver.metadata.warnings_action', 'error'):
|
||||
fdroidserver.metadata.parse_yaml_metadata(mf, result)
|
||||
self.assertDictEqual(result, {'AutoName': 'F-Droid',
|
||||
'RepoType': 'git',
|
||||
'Builds': [{'versionCode': 1,
|
||||
'versionName': 'v0.1.0',
|
||||
'prebuild': "a && b && "
|
||||
"sed -i 's,a,b,'"}]})
|
||||
|
||||
def test_write_yaml_prebuild(self):
|
||||
mf = io.StringIO()
|
||||
app = fdroidserver.metadata.App()
|
||||
|
Loading…
Reference in New Issue
Block a user