mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
refactor: rename plugin to extention, httprunner/plugins -> httprunner/ext
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
# NOTICE:
|
||||
# This file should not be deleted, or ImportError will be raised in Python 2.7 when importing plugin
|
||||
# This file should not be deleted, or ImportError will be raised in Python 2.7 when importing extension
|
||||
4
httprunner/ext/locusts/__main__.py
Normal file
4
httprunner/ext/locusts/__main__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from httprunner.ext.locusts.cli import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -5,7 +5,7 @@ from locust import HttpLocust, TaskSet, task
|
||||
from locust.events import request_failure
|
||||
|
||||
from httprunner.exceptions import MyBaseError, MyBaseFailure
|
||||
from httprunner.plugins.locusts.utils import prepare_locust_tests
|
||||
from httprunner.ext.locusts.utils import prepare_locust_tests
|
||||
from httprunner.runner import Runner
|
||||
|
||||
logging.getLogger().setLevel(logging.CRITICAL)
|
||||
@@ -1,6 +1,6 @@
|
||||
""" upload test plugin.
|
||||
""" upload test extension.
|
||||
|
||||
If you want to use this plugin, you should install the following dependencies first.
|
||||
If you want to use this extension, you should install the following dependencies first.
|
||||
|
||||
- requests_toolbelt
|
||||
- filetype
|
||||
@@ -50,7 +50,7 @@ try:
|
||||
from requests_toolbelt import MultipartEncoder
|
||||
except ImportError:
|
||||
msg = """
|
||||
uploader plugin dependencies uninstalled, install first and try again.
|
||||
uploader extension dependencies uninstalled, install first and try again.
|
||||
install with pip:
|
||||
$ pip install requests_toolbelt filetype
|
||||
"""
|
||||
@@ -429,8 +429,8 @@ def get_mapping_function(function_name, functions_mapping):
|
||||
return utils.get_os_environ
|
||||
|
||||
elif function_name in ["multipart_encoder", "multipart_content_type"]:
|
||||
# plugin for upload test
|
||||
from httprunner.plugins import uploader
|
||||
# extension for upload test
|
||||
from httprunner.ext import uploader
|
||||
return getattr(uploader, function_name)
|
||||
|
||||
try:
|
||||
@@ -1158,7 +1158,7 @@ def __prepare_testcase_tests(tests, config, project_mapping, session_variables_s
|
||||
test_dict["request"]["verify"] = config_verify
|
||||
|
||||
if "upload" in test_dict["request"]:
|
||||
from httprunner.plugins.uploader import prepare_upload_test
|
||||
from httprunner.ext.uploader import prepare_upload_test
|
||||
prepare_upload_test(test_dict)
|
||||
|
||||
# current teststep variables
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
from httprunner.plugins.locusts.cli import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from httprunner.plugins.locusts.utils import prepare_locust_tests
|
||||
from httprunner.ext.locusts.utils import prepare_locust_tests
|
||||
|
||||
|
||||
class TestLocust(unittest.TestCase):
|
||||
Reference in New Issue
Block a user