we need FullLoader for one test, we are dumping custom objects
This commit is contained in:
parent
9bf0758f19
commit
e613b65098
|
@ -26,6 +26,11 @@ try:
|
|||
except ImportError:
|
||||
from yaml import SafeLoader
|
||||
|
||||
try:
|
||||
from yaml import CFullLoader as FullLoader
|
||||
except ImportError:
|
||||
from yaml import FullLoader
|
||||
|
||||
localmodule = os.path.realpath(
|
||||
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))
|
||||
print('localmodule: ' + localmodule)
|
||||
|
@ -594,13 +599,10 @@ class UpdateTest(unittest.TestCase):
|
|||
fdroidserver.common.fill_config_defaults(config)
|
||||
fdroidserver.update.config = config
|
||||
os.chdir(os.path.join(localmodule, 'tests'))
|
||||
if os.path.basename(os.getcwd()) != 'tests':
|
||||
raise Exception('This test must be run in the "tests/" subdir')
|
||||
|
||||
config['ndk_paths'] = dict()
|
||||
fdroidserver.common.config = config
|
||||
fdroidserver.update.config = config
|
||||
|
||||
fdroidserver.update.options = type('', (), {})()
|
||||
fdroidserver.update.options.clean = True
|
||||
fdroidserver.update.options.rename_apks = False
|
||||
|
@ -641,7 +643,7 @@ class UpdateTest(unittest.TestCase):
|
|||
# yaml.dump(apk, f, default_flow_style=False)
|
||||
|
||||
with open(savepath, 'r') as f:
|
||||
from_yaml = yaml.load(f, Loader=SafeLoader)
|
||||
from_yaml = yaml.load(f, Loader=FullLoader)
|
||||
self.maxDiff = None
|
||||
self.assertEqual(apk, from_yaml)
|
||||
|
||||
|
|
Loading…
Reference in New Issue