mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
Merge pull request #263 from vjFaLk/remove-app-fix
[fix] test case for remove-app
This commit is contained in:
commit
05eee95cab
@ -105,7 +105,7 @@ def install_app(app, bench_path='.', verbose=False):
|
|||||||
|
|
||||||
|
|
||||||
def remove_app(app, bench_path='.'):
|
def remove_app(app, bench_path='.'):
|
||||||
if not app in get_apps():
|
if not app in get_apps(bench_path):
|
||||||
print "No app named {0}".format(app)
|
print "No app named {0}".format(app)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@ -121,10 +121,10 @@ def remove_app(app, bench_path='.'):
|
|||||||
print "Cannot remove, app is installed on site: {0}".format(site)
|
print "Cannot remove, app is installed on site: {0}".format(site)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
exec_cmd(["{0} uninstall -y {1}".format(pip, app_path)], cwd=bench_path)
|
exec_cmd(["{0} uninstall -y {1}".format(pip, app_path)])
|
||||||
remove_from_appstxt(app, bench_path)
|
remove_from_appstxt(app, bench_path)
|
||||||
shutil.rmtree(app_path)
|
shutil.rmtree(app_path)
|
||||||
run_frappe_cmd("build", cwd=bench_path)
|
run_frappe_cmd("build", bench_path=bench_path)
|
||||||
if get_config(bench_path).get('restart_supervisor_on_update'):
|
if get_config(bench_path).get('restart_supervisor_on_update'):
|
||||||
restart_supervisor_processes(bench_path=bench_path)
|
restart_supervisor_processes(bench_path=bench_path)
|
||||||
|
|
||||||
|
@ -118,10 +118,8 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
def test_remove_app(self):
|
def test_remove_app(self):
|
||||||
site_name = "test-site-4.dev"
|
|
||||||
self.init_bench('test-bench')
|
self.init_bench('test-bench')
|
||||||
|
|
||||||
self.new_site(site_name)
|
|
||||||
bench_path = os.path.join(self.benches_path, "test-bench")
|
bench_path = os.path.join(self.benches_path, "test-bench")
|
||||||
|
|
||||||
# get app
|
# get app
|
||||||
|
Loading…
Reference in New Issue
Block a user