mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
ruamel.yaml is now required and the packages are all new enough
This commit is contained in:
parent
e794ccb38c
commit
8300ed051b
2 changed files with 9 additions and 52 deletions
|
|
@ -7,10 +7,8 @@ import sys
|
|||
import unittest
|
||||
import tempfile
|
||||
import textwrap
|
||||
from unittest import mock
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
from testcommon import TmpCwd
|
||||
|
||||
localmodule = Path(__file__).resolve().parent.parent
|
||||
|
|
@ -20,7 +18,6 @@ if localmodule not in sys.path:
|
|||
|
||||
from fdroidserver import common
|
||||
from fdroidserver import rewritemeta
|
||||
from fdroidserver.exception import FDroidException
|
||||
|
||||
|
||||
class RewriteMetaTest(unittest.TestCase):
|
||||
|
|
@ -71,24 +68,6 @@ class RewriteMetaTest(unittest.TestCase):
|
|||
),
|
||||
)
|
||||
|
||||
def test_rewrite_scenario_yml_no_ruamel(self):
|
||||
sys.argv = ['rewritemeta', 'a']
|
||||
with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
|
||||
Path('metadata').mkdir()
|
||||
with Path('metadata/a.yml').open('w') as f:
|
||||
f.write('AutoName: a')
|
||||
|
||||
def boom(*args):
|
||||
raise FDroidException(' '.join((str(x) for x in args)))
|
||||
|
||||
with mock.patch('importlib.util.find_spec', boom):
|
||||
with self.assertRaises(FDroidException):
|
||||
rewritemeta.main()
|
||||
|
||||
self.assertEqual(
|
||||
Path('metadata/a.yml').read_text(encoding='utf-8'), 'AutoName: a'
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = optparse.OptionParser()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue