mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 16:36:25 +00:00
Merge pull request #205 from shreyasp/fix-test-case
[Fix] Fixed drop site test case
This commit is contained in:
commit
ca97764209
@ -57,11 +57,10 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
})
|
})
|
||||||
|
|
||||||
def test_new_site(self):
|
def test_new_site(self):
|
||||||
|
self.init_bench('test-bench')
|
||||||
self.new_site("test-site-1.dev")
|
self.new_site("test-site-1.dev")
|
||||||
|
|
||||||
def new_site(self, site_name):
|
def new_site(self, site_name):
|
||||||
self.test_init()
|
|
||||||
|
|
||||||
new_site_cmd = ["bench", "new-site", site_name, "--admin-password", "admin"]
|
new_site_cmd = ["bench", "new-site", site_name, "--admin-password", "admin"]
|
||||||
|
|
||||||
# set in travis
|
# set in travis
|
||||||
@ -89,6 +88,7 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
def test_install_app(self):
|
def test_install_app(self):
|
||||||
site_name = "test-site-2.dev"
|
site_name = "test-site-2.dev"
|
||||||
|
|
||||||
|
self.init_bench('test-bench')
|
||||||
self.new_site(site_name)
|
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")
|
||||||
@ -112,12 +112,13 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
bench.utils.init(bench_name)
|
bench.utils.init(bench_name)
|
||||||
|
|
||||||
def test_drop_site(self):
|
def test_drop_site(self):
|
||||||
|
self.init_bench('test-bench')
|
||||||
# Check without archive_path given to drop-site command
|
# Check without archive_path given to drop-site command
|
||||||
self.drop_site("test-drop-without-archive-path")
|
self.drop_site("test-drop-without-archive-path")
|
||||||
|
|
||||||
# Check with archive_path given to drop-site command
|
# Check with archive_path given to drop-site command
|
||||||
home = os.path.abspath(os.path.expanduser('~'))
|
home = os.path.abspath(os.path.expanduser('~'))
|
||||||
archive_path = os.path.join(home, 'archived_sites')
|
archived_sites_path = os.path.join(home, 'archived_sites')
|
||||||
|
|
||||||
self.drop_site("test-drop-with-archive-path", archived_sites_path=archived_sites_path)
|
self.drop_site("test-drop-with-archive-path", archived_sites_path=archived_sites_path)
|
||||||
|
|
||||||
@ -145,7 +146,7 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
self.assertTrue(os.path.exists(archived_sites_path))
|
self.assertTrue(os.path.exists(archived_sites_path))
|
||||||
self.assertTrue(os.path.exists(os.path.join(archive_path, site_name)))
|
self.assertTrue(os.path.exists(os.path.join(archived_sites_path, site_name)))
|
||||||
|
|
||||||
def assert_folders(self, bench_name):
|
def assert_folders(self, bench_name):
|
||||||
for folder in bench.utils.folders_in_bench:
|
for folder in bench.utils.folders_in_bench:
|
||||||
|
Loading…
Reference in New Issue
Block a user