From b0c188ce51c821515e2fb96c8e3c3742cd0ba4e2 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Sun, 25 Jun 2017 20:29:59 +0800 Subject: [PATCH] change demo testcase file name --- ...demo_auth.json => simple_demo_auth_hardcode.json} | 0 .../{demo_auth.yml => simple_demo_auth_hardcode.yml} | 0 test/data/{demo.json => simple_demo_no_auth.json} | 0 test/data/{demo.yml => simple_demo_no_auth.yml} | 0 test/test_runner.py | 6 +++--- test/test_runner_v2.py | 12 ++++++++---- test/test_utils.py | 6 ++++-- 7 files changed, 15 insertions(+), 9 deletions(-) rename test/data/{demo_auth.json => simple_demo_auth_hardcode.json} (100%) rename test/data/{demo_auth.yml => simple_demo_auth_hardcode.yml} (100%) rename test/data/{demo.json => simple_demo_no_auth.json} (100%) rename test/data/{demo.yml => simple_demo_no_auth.yml} (100%) diff --git a/test/data/demo_auth.json b/test/data/simple_demo_auth_hardcode.json similarity index 100% rename from test/data/demo_auth.json rename to test/data/simple_demo_auth_hardcode.json diff --git a/test/data/demo_auth.yml b/test/data/simple_demo_auth_hardcode.yml similarity index 100% rename from test/data/demo_auth.yml rename to test/data/simple_demo_auth_hardcode.yml diff --git a/test/data/demo.json b/test/data/simple_demo_no_auth.json similarity index 100% rename from test/data/demo.json rename to test/data/simple_demo_no_auth.json diff --git a/test/data/demo.yml b/test/data/simple_demo_no_auth.yml similarity index 100% rename from test/data/demo.yml rename to test/data/simple_demo_no_auth.yml diff --git a/test/test_runner.py b/test/test_runner.py index 5a04cad6..cd4aa033 100644 --- a/test/test_runner.py +++ b/test/test_runner.py @@ -15,7 +15,7 @@ class TestRunner(ApiServerUnittest): return requests.delete(url) def test_run_single_testcase_success(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.json') + testcase_file_path = os.path.join(os.getcwd(), 'test/data/simple_demo_no_auth.json') testcases = utils.load_testcases(testcase_file_path) success, _ = self.test_runner.run_single_testcase(testcases[0]) self.assertTrue(success) @@ -70,14 +70,14 @@ class TestRunner(ApiServerUnittest): ) def test_run_testcase_suite_json_success(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.json') + testcase_file_path = os.path.join(os.getcwd(), 'test/data/simple_demo_no_auth.json') testcases = utils.load_testcases(testcase_file_path) result = self.test_runner.run_testcase_suite(testcases) self.assertEqual(len(result), 2) self.assertEqual(result, [(True, {}), (True, {})]) def test_run_testcase_suite_yaml_success(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.yml') + testcase_file_path = os.path.join(os.getcwd(), 'test/data/simple_demo_no_auth.yml') testcases = utils.load_testcases(testcase_file_path) result = self.test_runner.run_testcase_suite(testcases) self.assertEqual(len(result), 2) diff --git a/test/test_runner_v2.py b/test/test_runner_v2.py index 269ab41a..ba6b03be 100644 --- a/test/test_runner_v2.py +++ b/test/test_runner_v2.py @@ -17,26 +17,30 @@ class TestRunnerV2(ApiServerUnittest): return requests.delete(url, headers=self.prepare_headers()) def test_run_single_testcase_yaml(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo_auth.yml') + testcase_file_path = os.path.join( + os.getcwd(), 'test/data/simple_demo_auth_hardcode.yml') testcases = utils.load_testcases(testcase_file_path) success, _ = self.test_runner.run_single_testcase(testcases[0]) self.assertTrue(success) def test_run_single_testcase_json(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo_auth.json') + testcase_file_path = os.path.join( + os.getcwd(), 'test/data/simple_demo_auth_hardcode.json') testcases = utils.load_testcases(testcase_file_path) success, _ = self.test_runner.run_single_testcase(testcases[0]) self.assertTrue(success) def test_run_testcase_auth_suite_yaml(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo_auth.yml') + testcase_file_path = os.path.join( + os.getcwd(), 'test/data/simple_demo_auth_hardcode.yml') testcases = utils.load_testcases(testcase_file_path) result = self.test_runner.run_testcase_suite(testcases) self.assertEqual(len(result), 2) self.assertEqual(result, [(True, {}), (True, {})]) def test_run_testcase_auth_suite_json(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo_auth.json') + testcase_file_path = os.path.join( + os.getcwd(), 'test/data/simple_demo_auth_hardcode.json') testcases = utils.load_testcases(testcase_file_path) result = self.test_runner.run_testcase_suite(testcases) self.assertEqual(len(result), 2) diff --git a/test/test_utils.py b/test/test_utils.py index 182c6d7d..4aacc853 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -13,7 +13,8 @@ class TestUtils(ApiServerUnittest): utils.load_testcases(testcase_file_path) def test_load_json_testcases(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.json') + testcase_file_path = os.path.join( + os.getcwd(), 'test/data/simple_demo_no_auth.json') testcases = utils.load_testcases(testcase_file_path) self.assertEqual(len(testcases), 2) self.assertIn('name', testcases[0]) @@ -23,7 +24,8 @@ class TestUtils(ApiServerUnittest): self.assertIn('method', testcases[0]['request']) def test_load_yaml_testcases(self): - testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.yml') + testcase_file_path = os.path.join( + os.getcwd(), 'test/data/simple_demo_no_auth.yml') testcases = utils.load_testcases(testcase_file_path) self.assertEqual(len(testcases), 2) self.assertIn('name', testcases[0])