diff --git a/bench/tests/test_init.py b/bench/tests/test_init.py index 5aabea0e..8744a4a8 100755 --- a/bench/tests/test_init.py +++ b/bench/tests/test_init.py @@ -14,6 +14,9 @@ from bench.release import get_bumped_version from bench.tests.test_base import TestBenchBase +ERPNEXT_BRANCH = bench.tests.test_base.FRAPPE_BRANCH + + class TestBenchInit(TestBenchBase): def test_semantic_version(self): self.assertEqual( get_bumped_version('11.0.4', 'major'), '12.0.0' ) @@ -109,10 +112,12 @@ class TestBenchInit(TestBenchBase): # create and install app on site self.new_site(site_name, bench_name) - bench.utils.exec_cmd("bench --site {0} install-app erpnext".format(site_name), cwd=bench_path) + installed_erpnext = not bench.utils.exec_cmd("bench --site {0} install-app erpnext --branch {1}".format(site_name, ERPNEXT_BRANCH), cwd=bench_path) app_installed_on_site = subprocess.check_output(["bench", "--site", site_name, "list-apps"], cwd=bench_path).decode('utf8') - self.assertTrue("erpnext" in app_installed_on_site) + + if installed_erpnext: + self.assertTrue("erpnext" in app_installed_on_site) def test_remove_app(self): diff --git a/bench/utils.py b/bench/utils.py index 7834ceba..67ff3364 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -298,7 +298,7 @@ def exec_cmd(cmd, cwd='.'): import shlex print("{0}$ {1}{2}".format(color.silver, cmd, color.nc)) cmd = shlex.split(cmd) - subprocess.call(cmd, cwd=cwd, universal_newlines=True) + return subprocess.call(cmd, cwd=cwd, universal_newlines=True) def which(executable, raise_err = False):