metadata: make linkresolver an actual object

Previously this was magically capturing the apps dict when passing it around as a
function. This also moved the code to the metadata module.

Add a test doing read_metadata where the linkresolver is used. This
happens when the apps we read have a [[app.id]] link to another app.
This commit is contained in:
Marcus Hoffmann 2020-06-03 21:28:20 +02:00
parent a4177e5ec3
commit 03881154c6
6 changed files with 1240 additions and 18 deletions

View file

@ -905,6 +905,14 @@ class MetadataTest(unittest.TestCase):
'Subdir': None,
'Prepare': None}})
def test_read_xref_metadata(self):
fdroidserver.common.config = {'accepted_formats': ['yml']}
os.chdir('xref')
fdroidserver.metadata.warnings_action = 'error'
apps = fdroidserver.metadata.read_metadata(xref=True)
self.assertListEqual(list(apps.keys()),
['aarddict.android', 'org.coolreader', 'org.geometerplus.zlibrary.ui.android'])
if __name__ == "__main__":
os.chdir(os.path.dirname(__file__))