mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-03 17:50:11 +02:00
test that yaml parsing does not accept provides
This commit is contained in:
parent
191363ad55
commit
723bd110a6
@ -367,6 +367,24 @@ class MetadataTest(unittest.TestCase):
|
||||
'prebuild': "a && b && "
|
||||
"sed -i 's,a,b,'"}]})
|
||||
|
||||
def test_parse_yaml_provides_should_raise_exception(self):
|
||||
mf = io.StringIO(textwrap.dedent("""\
|
||||
Provides: this.is.deprecated
|
||||
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'):
|
||||
with self.assertRaises(fdroidserver.metadata.MetaDataException):
|
||||
fdroidserver.metadata.parse_yaml_metadata(mf, result)
|
||||
|
||||
def test_write_yaml_1_line_scripts_as_string(self):
|
||||
mf = io.StringIO()
|
||||
app = fdroidserver.metadata.App()
|
||||
|
Loading…
Reference in New Issue
Block a user