mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 09:02:10 +00:00
Added tests for remove-app
This commit is contained in:
parent
c3efdb01ab
commit
43e170e02d
@ -39,7 +39,7 @@ def new_app(app_name):
|
|||||||
@click.command('remove-app')
|
@click.command('remove-app')
|
||||||
@click.argument('app-name')
|
@click.argument('app-name')
|
||||||
def remove_app(app_name):
|
def remove_app(app_name):
|
||||||
"completely remove new app from bench"
|
"completely remove app from bench"
|
||||||
from bench.app import remove_app
|
from bench.app import remove_app
|
||||||
remove_app(app_name)
|
remove_app(app_name)
|
||||||
|
|
||||||
|
@ -116,6 +116,25 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
out = subprocess.check_output(["bench", "--site", site_name, "list-apps"], cwd=bench_path)
|
out = subprocess.check_output(["bench", "--site", site_name, "list-apps"], cwd=bench_path)
|
||||||
self.assertTrue("erpnext" in out)
|
self.assertTrue("erpnext" in out)
|
||||||
|
|
||||||
|
|
||||||
|
def test_remove_app(self):
|
||||||
|
site_name = "test-site-4.dev"
|
||||||
|
self.init_bench('test-bench')
|
||||||
|
|
||||||
|
self.new_site(site_name)
|
||||||
|
bench_path = os.path.join(self.benches_path, "test-bench")
|
||||||
|
|
||||||
|
# get app
|
||||||
|
bench.app.get_app("https://github.com/frappe/erpnext", "develop", bench_path=bench_path)
|
||||||
|
|
||||||
|
self.assertTrue(os.path.exists(os.path.join(bench_path, "apps", "erpnext")))
|
||||||
|
|
||||||
|
# remove it
|
||||||
|
bench.app.remove_app("erpnext", bench_path=bench_path)
|
||||||
|
|
||||||
|
self.assertFalse(os.path.exists(os.path.join(bench_path, "apps", "erpnext")))
|
||||||
|
|
||||||
|
|
||||||
def test_switch_to_branch(self):
|
def test_switch_to_branch(self):
|
||||||
self.init_bench('test-bench')
|
self.init_bench('test-bench')
|
||||||
|
|
||||||
|
@ -77,7 +77,6 @@ def exec_cmd(cmd, cwd='.'):
|
|||||||
stderr = stdout = subprocess.PIPE
|
stderr = stdout = subprocess.PIPE
|
||||||
else:
|
else:
|
||||||
stderr = stdout = None
|
stderr = stdout = None
|
||||||
print cmd
|
|
||||||
p = subprocess.Popen(cmd, cwd=cwd, shell=True, stdout=stdout, stderr=stderr)
|
p = subprocess.Popen(cmd, cwd=cwd, shell=True, stdout=stdout, stderr=stderr)
|
||||||
|
|
||||||
if async:
|
if async:
|
||||||
|
Loading…
Reference in New Issue
Block a user