mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +08:00
replace SuiteNotFound with TestcaseNotFound
This commit is contained in:
@@ -50,8 +50,5 @@ class VariableNotFound(NotFoundError):
|
|||||||
class ApiNotFound(NotFoundError):
|
class ApiNotFound(NotFoundError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class SuiteNotFound(NotFoundError):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class TestcaseNotFound(NotFoundError):
|
class TestcaseNotFound(NotFoundError):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -337,9 +337,9 @@ def _get_block_by_name(ref_call, ref_type):
|
|||||||
|
|
||||||
|
|
||||||
def _get_test_definition(name, ref_type):
|
def _get_test_definition(name, ref_type):
|
||||||
""" get expected api or suite.
|
""" get expected api or testcase.
|
||||||
@params:
|
@params:
|
||||||
name: api or suite name
|
name: api or testcase name
|
||||||
ref_type: "api" or "suite"
|
ref_type: "api" or "suite"
|
||||||
@return
|
@return
|
||||||
expected api info if found, otherwise raise ApiNotFound exception
|
expected api info if found, otherwise raise ApiNotFound exception
|
||||||
@@ -352,7 +352,7 @@ def _get_test_definition(name, ref_type):
|
|||||||
raise exceptions.ApiNotFound(err_msg)
|
raise exceptions.ApiNotFound(err_msg)
|
||||||
else:
|
else:
|
||||||
# ref_type == "suite":
|
# ref_type == "suite":
|
||||||
raise exceptions.SuiteNotFound(err_msg)
|
raise exceptions.TestcaseNotFound(err_msg)
|
||||||
|
|
||||||
return block
|
return block
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ class TestSuiteLoader(unittest.TestCase):
|
|||||||
api_def = loader._get_test_definition("create_and_check", "suite")
|
api_def = loader._get_test_definition("create_and_check", "suite")
|
||||||
self.assertEqual(api_def["config"]["name"], "create user and check result.")
|
self.assertEqual(api_def["config"]["name"], "create user and check result.")
|
||||||
|
|
||||||
with self.assertRaises(exceptions.SuiteNotFound):
|
with self.assertRaises(exceptions.TestcaseNotFound):
|
||||||
loader._get_test_definition("create_and_check_XXX", "suite")
|
loader._get_test_definition("create_and_check_XXX", "suite")
|
||||||
|
|
||||||
def test_merge_validator(self):
|
def test_merge_validator(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user