tests: run pip tests using fdroid that pip installed

This commit is contained in:
Hans-Christoph Steiner 2021-01-23 13:36:41 +01:00
parent f6b5f74ec6
commit aebf70a763
2 changed files with 11 additions and 2 deletions

View File

@ -129,7 +129,7 @@ ubuntu_bionic_pip:
- $pip install dist/fdroidserver-*.tar.gz
- tar xzf dist/fdroidserver-*.tar.gz
- cd fdroidserver-*
- ./tests/run-tests
- fdroid=`which fdroid` ./tests/run-tests
# test install process on a bleeding edge distro with pip
arch_pip_install:

View File

@ -830,8 +830,17 @@ class UpdateTest(unittest.TestCase):
# yaml.add_representer(fdroidserver.metadata.Build, _build_yaml_representer)
# yaml.dump(apk, f, default_flow_style=False)
# CFullLoader doesn't always work
# https://github.com/yaml/pyyaml/issues/266#issuecomment-559116876
TestLoader = FullLoader
try:
testyaml = '- !!python/object/new:fdroidserver.update.UsesPermission\n - test\n - null'
from_yaml = yaml.load(testyaml, Loader=TestLoader)
except yaml.constructor.ConstructorError:
from yaml import UnsafeLoader as TestLoader
with open(savepath, 'r') as f:
from_yaml = yaml.load(f, Loader=FullLoader)
from_yaml = yaml.load(f, Loader=TestLoader)
self.maxDiff = None
self.assertEqual(apk, from_yaml)