mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
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:
parent
4d6682bc70
commit
7ff32bc4b0
34 changed files with 471 additions and 1260 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue