From c0c170a35556eeb44530e1357b74aaf678dae7ed Mon Sep 17 00:00:00 2001 From: debugtalk Date: Thu, 23 Aug 2018 08:33:53 +0800 Subject: [PATCH] refactor create_scaffold: create new project structure --- httprunner/utils.py | 11 ++++++----- tests/test_utils.py | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/httprunner/utils.py b/httprunner/utils.py index c4a76220..be0c6b75 100644 --- a/httprunner/utils.py +++ b/httprunner/utils.py @@ -374,11 +374,12 @@ def create_scaffold(project_path): path_list = [ (project_path, "folder"), - (os.path.join(project_path, "tests"), "folder"), - (os.path.join(project_path, "tests", "api"), "folder"), - (os.path.join(project_path, "tests", "suite"), "folder"), - (os.path.join(project_path, "tests", "testcases"), "folder"), - (os.path.join(project_path, "tests", "debugtalk.py"), "file") + (os.path.join(project_path, "api"), "folder"), + (os.path.join(project_path, "testcases"), "folder"), + (os.path.join(project_path, "testsuites"), "folder"), + (os.path.join(project_path, "reports"), "folder"), + (os.path.join(project_path, "debugtalk.py"), "file"), + (os.path.join(project_path, ".env"), "file") ] msg = "" diff --git a/tests/test_utils.py b/tests/test_utils.py index 2a5c699d..5d6fbad8 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -254,11 +254,12 @@ class TestUtils(ApiServerUnittest): def test_create_scaffold(self): project_path = os.path.join(os.getcwd(), "projectABC") 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, "tests", "api"))) - self.assertTrue(os.path.isdir(os.path.join(project_path, "tests", "suite"))) - self.assertTrue(os.path.isdir(os.path.join(project_path, "tests", "testcases"))) - self.assertTrue(os.path.isfile(os.path.join(project_path, "tests", "debugtalk.py"))) + self.assertTrue(os.path.isdir(os.path.join(project_path, "api"))) + self.assertTrue(os.path.isdir(os.path.join(project_path, "testcases"))) + self.assertTrue(os.path.isdir(os.path.join(project_path, "testsuites"))) + self.assertTrue(os.path.isdir(os.path.join(project_path, "reports"))) + 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) def test_cartesian_product_one(self):