1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 02:50:12 +01:00

stick to default python sys.path

This commit is contained in:
Michael Pöhn 2020-01-29 13:08:43 +01:00
parent 3a3803ea2d
commit b257a3411a
2 changed files with 7 additions and 5 deletions

View File

@ -91,7 +91,6 @@ def find_plugins():
def main(): def main():
sys.path.append(os.getcwd())
fdroid_modules = find_plugins() fdroid_modules = find_plugins()
if len(sys.argv) <= 1: if len(sys.argv) <= 1:

View File

@ -84,10 +84,13 @@ class MainTest(unittest.TestCase):
f.write(textwrap.dedent("""\ f.write(textwrap.dedent("""\
fdroid_summary = "ttt" fdroid_summary = "ttt"
main = lambda: pritn('all good')""")) main = lambda: pritn('all good')"""))
with mock.patch('sys.argv', ['', 'testy']): test_path = sys.path.copy()
with mock.patch('sys.exit') as exit_mock: test_path.append(tmpdir)
fdroidserver.__main__.main() with mock.patch('sys.path', test_path):
exit_mock.assert_called_once_with(0) with mock.patch('sys.argv', ['', 'testy']):
with mock.patch('sys.exit') as exit_mock:
fdroidserver.__main__.main()
exit_mock.assert_called_once_with(0)
if __name__ == "__main__": if __name__ == "__main__":