mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-20 15:50:47 +08:00
refactor create_scaffold: create new project structure
This commit is contained in:
@@ -374,11 +374,12 @@ def create_scaffold(project_path):
|
|||||||
|
|
||||||
path_list = [
|
path_list = [
|
||||||
(project_path, "folder"),
|
(project_path, "folder"),
|
||||||
(os.path.join(project_path, "tests"), "folder"),
|
(os.path.join(project_path, "api"), "folder"),
|
||||||
(os.path.join(project_path, "tests", "api"), "folder"),
|
(os.path.join(project_path, "testcases"), "folder"),
|
||||||
(os.path.join(project_path, "tests", "suite"), "folder"),
|
(os.path.join(project_path, "testsuites"), "folder"),
|
||||||
(os.path.join(project_path, "tests", "testcases"), "folder"),
|
(os.path.join(project_path, "reports"), "folder"),
|
||||||
(os.path.join(project_path, "tests", "debugtalk.py"), "file")
|
(os.path.join(project_path, "debugtalk.py"), "file"),
|
||||||
|
(os.path.join(project_path, ".env"), "file")
|
||||||
]
|
]
|
||||||
|
|
||||||
msg = ""
|
msg = ""
|
||||||
|
|||||||
@@ -254,11 +254,12 @@ class TestUtils(ApiServerUnittest):
|
|||||||
def test_create_scaffold(self):
|
def test_create_scaffold(self):
|
||||||
project_path = os.path.join(os.getcwd(), "projectABC")
|
project_path = os.path.join(os.getcwd(), "projectABC")
|
||||||
utils.create_scaffold(project_path)
|
utils.create_scaffold(project_path)
|
||||||
self.assertTrue(os.path.isdir(os.path.join(project_path, "tests")))
|
self.assertTrue(os.path.isdir(os.path.join(project_path, "api")))
|
||||||
self.assertTrue(os.path.isdir(os.path.join(project_path, "tests", "api")))
|
self.assertTrue(os.path.isdir(os.path.join(project_path, "testcases")))
|
||||||
self.assertTrue(os.path.isdir(os.path.join(project_path, "tests", "suite")))
|
self.assertTrue(os.path.isdir(os.path.join(project_path, "testsuites")))
|
||||||
self.assertTrue(os.path.isdir(os.path.join(project_path, "tests", "testcases")))
|
self.assertTrue(os.path.isdir(os.path.join(project_path, "reports")))
|
||||||
self.assertTrue(os.path.isfile(os.path.join(project_path, "tests", "debugtalk.py")))
|
self.assertTrue(os.path.isfile(os.path.join(project_path, "debugtalk.py")))
|
||||||
|
self.assertTrue(os.path.isfile(os.path.join(project_path, ".env")))
|
||||||
shutil.rmtree(project_path)
|
shutil.rmtree(project_path)
|
||||||
|
|
||||||
def test_cartesian_product_one(self):
|
def test_cartesian_product_one(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user