def test_get_test_definition_suite(self): loader._load_test_dependencies() api_def = loader._get_test_definition("create_and_check", "suite") self.assertEqual(api_def["config"]["name"], "create user and check result.") with self.assertRaises(exceptions.TestcaseNotFound): loader._get_test_definition("create_and_check_XXX", "suite")
def test_get_test_definition_api(self): api_def = loader._get_test_definition("get_headers", "def-api") self.assertEqual(api_def["request"]["url"], "/headers") self.assertEqual(len(api_def["setup_hooks"]), 2) self.assertEqual(len(api_def["teardown_hooks"]), 1) with self.assertRaises(exceptions.ApiNotFound): loader._get_test_definition("get_token_XXX", "def-api")
def test_get_test_definition_suite(self): api_def = loader._get_test_definition("create_and_check", "def-testcase", self.project_mapping) self.assertEqual(api_def["config"]["name"], "create user and check result.") with self.assertRaises(exceptions.TestcaseNotFound): loader._get_test_definition("create_and_check_XXX", "def-testcase", self.project_mapping)
def test_get_test_definition_suite(self): suite_def = loader._get_test_definition('create_and_check', 'def-testcase') assert suite_def['config']['name'] == 'create user and check result.' with pytest.raises(exceptions.TestcaseNotFound): loader._get_test_definition('create_and_check_xxx', 'def-testcase')
def test_get_test_definition_api(self): api_def = loader._get_test_definition('get_headers', 'def-api') assert api_def['request']['url'] == '/headers' assert len(api_def['setup_hooks']) == 2 assert len(api_def['teardown_hooks']) == 1