From 7bffdda3aa2c428c3a1e535a824eb9470476efb9 Mon Sep 17 00:00:00 2001 From: luowentao Date: Mon, 11 Sep 2017 20:44:57 +0800 Subject: [PATCH] refactor: fix typos --- ate/context.py | 2 +- ate/task.py | 2 +- ate/utils.py | 4 ++-- tests/test_testcase.py | 2 +- tests/test_utils.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ate/context.py b/ate/context.py index 071fa83c..5214c0bc 100644 --- a/ate/context.py +++ b/ate/context.py @@ -42,7 +42,7 @@ class Context(object): self.import_module_items(["ate.built_in"], "testset") def import_requires(self, modules): - """ import required modules dynamicly + """ import required modules dynamically """ for module_name in modules: globals()[module_name] = utils.get_imported_module(module_name) diff --git a/ate/task.py b/ate/task.py index a85f08b9..5ae997ab 100644 --- a/ate/task.py +++ b/ate/task.py @@ -18,7 +18,7 @@ class ApiTestCase(unittest.TestCase): def create_suite(testset): """ create test suite with a testset, it may include one or several testcases. - each suite should initialize a seperate Runner() with testset config. + each suite should initialize a separate Runner() with testset config. """ suite = unittest.TestSuite() diff --git a/ate/utils.py b/ate/utils.py index 1a21921a..a760f443 100644 --- a/ate/utils.py +++ b/ate/utils.py @@ -57,7 +57,7 @@ def load_testcases(testcase_file_path): # '' or other suffix return [] -def load_foler_files(folder_path, match_filter_list=["*"]): +def load_folder_files(folder_path, match_filter_list=["*"]): """ load folder path, return all files in list format. """ file_list = [] @@ -99,7 +99,7 @@ def load_testcases_by_path(path): path = os.path.join(os.getcwd(), path) if os.path.isdir(path): - files_list = load_foler_files(path, ["*.yml", "*.yaml", "*.json"]) + files_list = load_folder_files(path, ["*.yml", "*.yaml", "*.json"]) return load_testcases_by_path(files_list) elif os.path.isfile(path): diff --git a/tests/test_testcase.py b/tests/test_testcase.py index 8626e969..1bebfe10 100644 --- a/tests/test_testcase.py +++ b/tests/test_testcase.py @@ -118,7 +118,7 @@ class TestcaseParserUnittest(unittest.TestCase): self.assertEqual(testcase.parse_string_value("$var"), "$var") self.assertEqual(testcase.parse_string_value("${func}"), "${func}") - def test_parse_functon(self): + def test_parse_function(self): self.assertEqual( testcase.parse_function("${func()}"), {'func_name': 'func', 'args': [], 'kwargs': {}} diff --git a/tests/test_utils.py b/tests/test_utils.py index 4b6a7e43..51babe00 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -31,12 +31,12 @@ class TestUtils(ApiServerUnittest): self.assertIn('url', testcase['request']) self.assertIn('method', testcase['request']) - def test_load_foler_files(self): + def test_load_folder_files(self): folder = os.path.join(os.getcwd(), 'tests') file1 = os.path.join(os.getcwd(), 'tests', 'test_utils.py') file2 = os.path.join(os.getcwd(), 'tests', 'data', 'demo_binds.yml') - files = utils.load_foler_files(folder, ["*.py"]) + files = utils.load_folder_files(folder, ["*.py"]) self.assertIn(file1, files) self.assertNotIn(file2, files)