mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-14 19:20:29 +03:00
Rework app into a class
This simplifies usage, goes from app['Foo'] to app.Foo Also makes static analyzers able to detect invalid attributes as the set is now limited in the class definition. As a bonus, setting of the default field values is now done in the constructor, not separately and manually.
This commit is contained in:
parent
de12cfdbe1
commit
ab614ab442
18 changed files with 515 additions and 433 deletions
|
|
@ -30,12 +30,12 @@ class ImportTest(unittest.TestCase):
|
|||
fdroidserver.common.config['sdk_path'] = '/fake/path/to/android-sdk'
|
||||
|
||||
url = 'https://gitlab.com/fdroid/fdroidclient'
|
||||
appid, app = fdroidserver.metadata.get_default_app_info()
|
||||
app['Update Check Mode'] = "Tags"
|
||||
app = fdroidserver.metadata.get_default_app_info()
|
||||
app.UpdateCheckMode = "Tags"
|
||||
root_dir, src_dir = import_proxy.get_metadata_from_url(app, url)
|
||||
self.assertEquals(app['Repo Type'], 'git')
|
||||
self.assertEquals(app['Web Site'], 'https://gitlab.com/fdroid/fdroidclient')
|
||||
self.assertEquals(app['Repo'], 'https://gitlab.com/fdroid/fdroidclient.git')
|
||||
self.assertEquals(app.RepoType, 'git')
|
||||
self.assertEquals(app.WebSite, 'https://gitlab.com/fdroid/fdroidclient')
|
||||
self.assertEquals(app.Repo, 'https://gitlab.com/fdroid/fdroidclient.git')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue