From 3c5944623a52b6f128e782d6664e03a683d3d0b6 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Sat, 19 Feb 2022 09:50:20 +0530 Subject: [PATCH 1/2] fix: clearer docstrings --- bench/bench.py | 6 +++--- bench/commands/setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bench/bench.py b/bench/bench.py index 9cce57b4..f359be7c 100644 --- a/bench/bench.py +++ b/bench/bench.py @@ -327,7 +327,7 @@ class BenchSetup(Base): @job(title="Setting Up Bench Dependencies", success="Bench Dependencies Set Up") def requirements(self, apps=None): - """Install and upgrade all installed apps on given Bench if apps not specified + """Install and upgrade specified / all installed apps on given Bench """ from bench.app import App @@ -342,7 +342,7 @@ class BenchSetup(Base): App(app, bench=self.bench, to_clone=False).install( skip_assets=True, restart_bench=False) def python(self, apps=None): - """Install and upgrade Python dependencies for installed apps on given Bench if app not specified + """Install and upgrade Python dependencies for specified / all installed apps on given Bench """ import bench.cli @@ -359,7 +359,7 @@ class BenchSetup(Base): self.run(f"{self.bench.python} -m pip install {quiet_flag} --upgrade -e {app_path}") def node(self, apps=None): - """Install and upgrade Node dependencies for all apps on given Bench if app not specified + """Install and upgrade Node dependencies for specified / all apps on given Bench """ from bench.utils.bench import update_node_packages diff --git a/bench/commands/setup.py b/bench/commands/setup.py index b8d4bee3..a6526cda 100755 --- a/bench/commands/setup.py +++ b/bench/commands/setup.py @@ -140,7 +140,7 @@ def setup_requirements(node=False, python=False, dev=False, apps=None): """ Setup Python and Node dependencies. - You can optionally specify one or more apps to specify dependencies for. + You can optionally specify one or more apps to setup dependencies for. """ from bench.bench import Bench From 3dcd28f5690d0fcb1abe53ee26a059036241625b Mon Sep 17 00:00:00 2001 From: Aradhya Date: Wed, 23 Feb 2022 21:53:08 +0530 Subject: [PATCH 2/2] test: updated tests to check for correct parsing of file uris --- bench/tests/test_init.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bench/tests/test_init.py b/bench/tests/test_init.py index 52c23282..80018b59 100755 --- a/bench/tests/test_init.py +++ b/bench/tests/test_init.py @@ -10,6 +10,7 @@ import git # imports - module imports from bench.utils import exec_cmd from bench.release import get_bumped_version +from bench.app import App from bench.tests.test_base import FRAPPE_BRANCH, TestBenchBase @@ -34,9 +35,10 @@ class TestBenchInit(TestBenchBase): def test_utils(self): self.assertEqual(subprocess.call("bench"), 0) - def test_init(self, bench_name="test-bench", **kwargs): self.init_bench(bench_name, **kwargs) + app = App("file:///tmp/frappe") + self.assertEqual(app.url, "/tmp/frappe") self.assert_folders(bench_name) self.assert_virtual_env(bench_name) self.assert_config(bench_name)