mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
rename package name from ate to httprunner
This commit is contained in:
@@ -8,6 +8,6 @@ python:
|
||||
install:
|
||||
- pip install -r requirements.txt
|
||||
script:
|
||||
- coverage run --source=ate -m unittest discover
|
||||
- coverage run --source=httprunner -m unittest discover
|
||||
after_success:
|
||||
- coveralls
|
||||
@@ -1 +1,2 @@
|
||||
include README.md
|
||||
include README.md
|
||||
include requirements.txt
|
||||
18
README.md
18
README.md
@@ -35,18 +35,18 @@ To upgrade all specified packages to the newest available version, you should ad
|
||||
|
||||
If there is a problem with the installation or upgrade, you can check the [`FAQ`](docs/FAQ.md).
|
||||
|
||||
To ensure the installation or upgrade is successful, you can execute command `ate -V` to see if you can get the correct version number.
|
||||
To ensure the installation or upgrade is successful, you can execute command `httprunner -V` to see if you can get the correct version number.
|
||||
|
||||
```text
|
||||
$ ate -V
|
||||
$ httprunner -V
|
||||
HttpRunner version: 0.8.0
|
||||
```
|
||||
|
||||
Execute the command `ate -h` to view command help.
|
||||
Execute the command `httprunner -h` to view command help.
|
||||
|
||||
```text
|
||||
$ ate -h
|
||||
usage: ate [-h] [-V] [--log-level LOG_LEVEL] [--report-name REPORT_NAME]
|
||||
$ httprunner -h
|
||||
usage: httprunner [-h] [-V] [--log-level LOG_LEVEL] [--report-name REPORT_NAME]
|
||||
[--failfast] [--startproject STARTPROJECT]
|
||||
[testset_paths [testset_paths ...]]
|
||||
|
||||
@@ -131,25 +131,25 @@ For detailed regulations of writing testcases, you can read the [`QuickStart`][q
|
||||
You can run single testset by specifying testset file path.
|
||||
|
||||
```text
|
||||
$ ate filepath/testcase.yml
|
||||
$ httprunner filepath/testcase.yml
|
||||
```
|
||||
|
||||
You can also run several testsets by specifying multiple testset file paths.
|
||||
|
||||
```text
|
||||
$ ate filepath1/testcase1.yml filepath2/testcase2.yml
|
||||
$ httprunner filepath1/testcase1.yml filepath2/testcase2.yml
|
||||
```
|
||||
|
||||
If you want to run testsets of a whole project, you can achieve this goal by specifying the project folder path.
|
||||
|
||||
```text
|
||||
$ ate testcases_folder_path
|
||||
$ httprunner testcases_folder_path
|
||||
```
|
||||
|
||||
When you do continuous integration test or production environment monitoring with `Jenkins`, you may need to send test result notification. For instance, you can send email with mailgun service as below.
|
||||
|
||||
```text
|
||||
$ ate filepath/testcase.yml --report-name ${BUILD_NUMBER} \
|
||||
$ httprunner filepath/testcase.yml --report-name ${BUILD_NUMBER} \
|
||||
--mailgun-smtp-username "qa@debugtalk.com" \
|
||||
--mailgun-smtp-password "12345678" \
|
||||
--email-sender excited@samples.mailgun.org \
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
__version__ = '0.8.0'
|
||||
1
httprunner/__init__.py
Normal file
1
httprunner/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__version__ = '0.8.1a'
|
||||
@@ -7,7 +7,7 @@ import random
|
||||
import string
|
||||
import time
|
||||
|
||||
from ate.exception import ParamsError
|
||||
from httprunner.exception import ParamsError
|
||||
|
||||
|
||||
def gen_random_string(str_len):
|
||||
@@ -6,10 +6,10 @@ from collections import OrderedDict
|
||||
|
||||
import PyUnitReport
|
||||
from PyUnitReport import __version__ as pyu_version
|
||||
from ate import __version__ as ate_version
|
||||
from ate import exception
|
||||
from ate.task import TaskSuite
|
||||
from ate.utils import create_scaffold
|
||||
from httprunner import __version__ as ate_version
|
||||
from httprunner import exception
|
||||
from httprunner.task import TaskSuite
|
||||
from httprunner.utils import create_scaffold
|
||||
|
||||
|
||||
def main_ate():
|
||||
@@ -98,7 +98,7 @@ def main_locust():
|
||||
""" Performance test with locust: parse command line options and run commands.
|
||||
"""
|
||||
try:
|
||||
from ate import locusts
|
||||
from httprunner import locusts
|
||||
except ImportError:
|
||||
print("Locust is not installed, exit.")
|
||||
exit(1)
|
||||
@@ -4,7 +4,7 @@ import re
|
||||
import time
|
||||
|
||||
import requests
|
||||
from ate.exception import ParamsError
|
||||
from httprunner.exception import ParamsError
|
||||
from requests import Request, Response
|
||||
from requests.exceptions import (InvalidSchema, InvalidURL, MissingSchema,
|
||||
RequestException)
|
||||
@@ -4,8 +4,8 @@ import re
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
|
||||
from ate import utils
|
||||
from ate.testcase import TestcaseParser
|
||||
from httprunner import utils
|
||||
from httprunner.testcase import TestcaseParser
|
||||
|
||||
|
||||
class Context(object):
|
||||
@@ -37,7 +37,7 @@ class Context(object):
|
||||
self.testcase_parser.update_binded_variables(self.testcase_variables_mapping)
|
||||
|
||||
if level == "testset":
|
||||
self.import_module_items(["ate.built_in"], "testset")
|
||||
self.import_module_items(["httprunner.built_in"], "testset")
|
||||
|
||||
def config_context(self, config_dict, level):
|
||||
if level == "testset":
|
||||
@@ -2,7 +2,7 @@
|
||||
import zmq
|
||||
from locust import HttpLocust, TaskSet, task
|
||||
from locust.events import request_failure
|
||||
from ate import runner
|
||||
from httprunner import runner
|
||||
|
||||
class WebPageTasks(TaskSet):
|
||||
def on_start(self):
|
||||
@@ -3,7 +3,7 @@ import multiprocessing
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ate.testcase import load_test_file
|
||||
from httprunner.testcase import load_test_file
|
||||
from locust.main import main
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import logging
|
||||
import re
|
||||
from collections import OrderedDict
|
||||
|
||||
from ate import exception, utils
|
||||
from httprunner import exception, utils
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
text_extractor_regexp_compile = re.compile(r".*\(.*\).*")
|
||||
@@ -1,8 +1,8 @@
|
||||
import logging
|
||||
|
||||
from ate import exception, response, testcase, utils
|
||||
from ate.client import HttpSession
|
||||
from ate.context import Context
|
||||
from httprunner import exception, response, testcase, utils
|
||||
from httprunner.client import HttpSession
|
||||
from httprunner.context import Context
|
||||
|
||||
|
||||
class Runner(object):
|
||||
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
from ate import exception, runner, testcase, utils
|
||||
from httprunner import exception, runner, testcase, utils
|
||||
|
||||
|
||||
class ApiTestCase(unittest.TestCase):
|
||||
@@ -6,7 +6,7 @@ import os
|
||||
import re
|
||||
|
||||
import yaml
|
||||
from ate import exception, utils
|
||||
from httprunner import exception, utils
|
||||
|
||||
variable_regexp = r"\$([\w_]+)"
|
||||
function_regexp = r"\$\{([\w_]+\([\$\w_ =,]*\))\}"
|
||||
@@ -11,7 +11,7 @@ import types
|
||||
from collections import OrderedDict
|
||||
|
||||
import yaml
|
||||
from ate import exception
|
||||
from httprunner import exception
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
try:
|
||||
@@ -1,5 +1,5 @@
|
||||
""" used for debugging
|
||||
"""
|
||||
|
||||
from ate.cli import main_ate
|
||||
from httprunner.cli import main_ate
|
||||
main_ate()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
""" used for debugging
|
||||
"""
|
||||
|
||||
from ate.cli import main_locust
|
||||
from httprunner.cli import main_locust
|
||||
main_locust()
|
||||
|
||||
9
setup.py
9
setup.py
@@ -1,7 +1,7 @@
|
||||
#encoding: utf-8
|
||||
import io
|
||||
|
||||
from ate import __version__
|
||||
from httprunner import __version__
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
with io.open("README.md", encoding='utf-8') as f:
|
||||
@@ -20,7 +20,7 @@ setup(
|
||||
license='MIT',
|
||||
packages=find_packages(exclude=['test.*', 'test']),
|
||||
package_data={
|
||||
'ate': ['locustfile_template'],
|
||||
'httprunner': ['locustfile_template'],
|
||||
},
|
||||
keywords='api test',
|
||||
install_requires=install_requires,
|
||||
@@ -33,8 +33,9 @@ setup(
|
||||
],
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'ate=ate.cli:main_ate',
|
||||
'locusts=ate.cli:main_locust'
|
||||
'ate=httprunner.cli:main_ate',
|
||||
'httprunner=httprunner.cli:main_ate',
|
||||
'locusts=httprunner.cli:main_locust'
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@ import hashlib
|
||||
import json
|
||||
from functools import wraps
|
||||
|
||||
from ate import utils
|
||||
from httprunner import utils
|
||||
from flask import Flask, make_response, request
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@@ -3,7 +3,7 @@ import time
|
||||
import unittest
|
||||
|
||||
import requests
|
||||
from ate import utils
|
||||
from httprunner import utils
|
||||
from tests import api_server
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from ate.client import HttpSession, prepare_kwargs
|
||||
from httprunner.client import HttpSession, prepare_kwargs
|
||||
from tests.base import ApiServerUnittest
|
||||
|
||||
class TestHttpClient(ApiServerUnittest):
|
||||
|
||||
@@ -2,9 +2,9 @@ import os
|
||||
import time
|
||||
import unittest
|
||||
|
||||
from ate import runner, testcase, utils
|
||||
from ate.context import Context
|
||||
from ate.exception import ParamsError
|
||||
from httprunner import runner, testcase, utils
|
||||
from httprunner.context import Context
|
||||
from httprunner.exception import ParamsError
|
||||
|
||||
|
||||
class VariableBindsUnittest(unittest.TestCase):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import requests
|
||||
from ate import response, exception
|
||||
from httprunner import response, exception
|
||||
from tests.base import ApiServerUnittest
|
||||
|
||||
class TestResponse(ApiServerUnittest):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
from ate import exception, runner, testcase
|
||||
from httprunner import exception, runner, testcase
|
||||
|
||||
from tests.base import ApiServerUnittest
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
|
||||
from ate import task
|
||||
from ate.testcase import load_test_file
|
||||
from httprunner import task
|
||||
from httprunner.testcase import load_test_file
|
||||
from tests.base import ApiServerUnittest
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import os
|
||||
import time
|
||||
import unittest
|
||||
|
||||
from ate import testcase
|
||||
from ate.exception import ApiNotFound, FileFormatError, ParamsError
|
||||
from httprunner import testcase
|
||||
from httprunner.exception import ApiNotFound, FileFormatError, ParamsError
|
||||
|
||||
|
||||
class TestcaseParserUnittest(unittest.TestCase):
|
||||
|
||||
@@ -2,7 +2,7 @@ import os
|
||||
import shutil
|
||||
from collections import OrderedDict
|
||||
|
||||
from ate import exception, utils
|
||||
from httprunner import exception, utils
|
||||
from tests.base import ApiServerUnittest
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ class TestUtils(ApiServerUnittest):
|
||||
self.assertIn("walk", dir(imported_module))
|
||||
|
||||
def test_filter_module_functions(self):
|
||||
imported_module = utils.get_imported_module("ate.utils")
|
||||
imported_module = utils.get_imported_module("httprunner.utils")
|
||||
self.assertIn("PYTHON_VERSION", dir(imported_module))
|
||||
|
||||
functions_dict = utils.filter_module(imported_module, "function")
|
||||
|
||||
Reference in New Issue
Block a user