Refactor TestCase files into python modules

Convert all TestCase files into standard python modules to be run and
discovered by unittest.
This commit is contained in:
SilentGhost 2024-11-19 20:36:41 +01:00 committed by Hans-Christoph Steiner
parent 4d6682bc70
commit 7ff32bc4b0
34 changed files with 471 additions and 1260 deletions

View file

@ -78,19 +78,6 @@ def mkdir_testfiles(localmodule, test):
return tempfile.mkdtemp(dir=testdir)
def parse_args_for_test(parser, args):
"""Only send --flags to the ArgumentParser, not test classes, etc."""
from fdroidserver.common import parse_args
flags = []
for arg in args:
if arg[0] == '-':
flags.append(flags)
with unittest.mock.patch('sys.argv', flags):
parse_args(parser)
def mock_urlopen(status=200, body=None):
resp = unittest.mock.MagicMock()
resp.getcode.return_value = status