def patched_cli(): dirpath = tempfile.mkdtemp() dir = os.path.join(dirpath, "apps") testargs = ["py4web", 'setup', dir] with patch.object(sys, "argv", testargs): cli() testargs = ["py4web", "run", "-d", "demo", dir] with patch.object(sys, "argv", testargs): cli()
#!/usr/bin/env python3 from py4web.core import cli cli()