refactor: rename plugin to extention, httprunner/plugins -> httprunner/ext

This commit is contained in:
debugtalk
2019-12-13 10:38:30 +08:00
parent c47442b67a
commit 9b5f150604
12 changed files with 13 additions and 13 deletions

View File

@@ -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

View File

@@ -0,0 +1,4 @@
from httprunner.ext.locusts.cli import main
if __name__ == "__main__":
main()

View File

@@ -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)

View File

@@ -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
"""

View File

@@ -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

View File

@@ -1,4 +0,0 @@
from httprunner.plugins.locusts.cli import main
if __name__ == "__main__":
main()

View File

@@ -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):