mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
add test for allowing to write placeholder values to yaml metadata files
This commit is contained in:
parent
3bea689f74
commit
67e46694d3
@ -165,6 +165,51 @@ class MetadataTest(unittest.TestCase):
|
||||
with self.assertRaises(MetaDataException):
|
||||
fdroidserver.metadata.parse_yaml_metadata(mf, {})
|
||||
|
||||
def test_write_yaml_with_allow_placeholder_values(self):
|
||||
mf = io.StringIO()
|
||||
|
||||
app = fdroidserver.metadata.App()
|
||||
app.Categories = ['None']
|
||||
app.SourceCode = "https://gitlab.com/fdroid/fdroidclient.git"
|
||||
app.IssueTracker = "https://gitlab.com/fdroid/fdroidclient/issues"
|
||||
app.RepoType = 'git'
|
||||
app.Repo = 'https://gitlab.com/fdroid/fdroidclient.git'
|
||||
app.AutoUpdateMode = 'None'
|
||||
app.UpdateCheckMode = 'Tags'
|
||||
build = fdroidserver.metadata.Build()
|
||||
build.versionCode = 'Unknown'
|
||||
build.versionName = 'Unknown'
|
||||
build.disable = 'Generated by import.py ...'
|
||||
build.commit = 'Unknown'
|
||||
build.gradle = [True]
|
||||
app.builds = [build]
|
||||
|
||||
fdroidserver.metadata.write_yaml(mf, app,
|
||||
allow_placeholder_values=True)
|
||||
|
||||
mf.seek(0)
|
||||
self.assertEqual(mf.read(), textwrap.dedent("""\
|
||||
Categories:
|
||||
- None
|
||||
License: Unknown
|
||||
SourceCode: https://gitlab.com/fdroid/fdroidclient.git
|
||||
IssueTracker: https://gitlab.com/fdroid/fdroidclient/issues
|
||||
|
||||
RepoType: git
|
||||
Repo: https://gitlab.com/fdroid/fdroidclient.git
|
||||
|
||||
Builds:
|
||||
- versionName: Unknown
|
||||
versionCode: '?'
|
||||
disable: Generated by import.py ...
|
||||
commit: Unknown
|
||||
gradle:
|
||||
- true
|
||||
|
||||
AutoUpdateMode: None
|
||||
UpdateCheckMode: Tags
|
||||
"""))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
|
Loading…
Reference in New Issue
Block a user