diff --git a/.travis.yml b/.travis.yml index c7aeb3f3..b16f4417 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 4bf44835..3d387c34 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,2 @@ -include README.md \ No newline at end of file +include README.md +include requirements.txt \ No newline at end of file diff --git a/README.md b/README.md index 3a5314b5..fc77c568 100644 --- a/README.md +++ b/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 \ diff --git a/ate/__init__.py b/ate/__init__.py deleted file mode 100644 index ccf9e628..00000000 --- a/ate/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.8.0' \ No newline at end of file diff --git a/httprunner/__init__.py b/httprunner/__init__.py new file mode 100644 index 00000000..3376f842 --- /dev/null +++ b/httprunner/__init__.py @@ -0,0 +1 @@ +__version__ = '0.8.1a' \ No newline at end of file diff --git a/ate/built_in.py b/httprunner/built_in.py similarity index 94% rename from ate/built_in.py rename to httprunner/built_in.py index cf272609..b1a5a32f 100644 --- a/ate/built_in.py +++ b/httprunner/built_in.py @@ -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): diff --git a/ate/cli.py b/httprunner/cli.py similarity index 94% rename from ate/cli.py rename to httprunner/cli.py index 0f1620ab..b2c488a4 100644 --- a/ate/cli.py +++ b/httprunner/cli.py @@ -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) diff --git a/ate/client.py b/httprunner/client.py similarity index 99% rename from ate/client.py rename to httprunner/client.py index 8c1cdca1..610f6bb3 100644 --- a/ate/client.py +++ b/httprunner/client.py @@ -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) diff --git a/ate/context.py b/httprunner/context.py similarity index 97% rename from ate/context.py rename to httprunner/context.py index cda6c5a3..e9e5bd83 100644 --- a/ate/context.py +++ b/httprunner/context.py @@ -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": diff --git a/ate/exception.py b/httprunner/exception.py similarity index 100% rename from ate/exception.py rename to httprunner/exception.py diff --git a/ate/locustfile_template b/httprunner/locustfile_template similarity index 94% rename from ate/locustfile_template rename to httprunner/locustfile_template index 6d4bf2c0..448a24c3 100644 --- a/ate/locustfile_template +++ b/httprunner/locustfile_template @@ -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): diff --git a/ate/locusts.py b/httprunner/locusts.py similarity index 97% rename from ate/locusts.py rename to httprunner/locusts.py index 1f808d2f..11ade7a2 100644 --- a/ate/locusts.py +++ b/httprunner/locusts.py @@ -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 diff --git a/ate/response.py b/httprunner/response.py similarity index 99% rename from ate/response.py rename to httprunner/response.py index cb38038b..d39be0b1 100644 --- a/ate/response.py +++ b/httprunner/response.py @@ -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".*\(.*\).*") diff --git a/ate/runner.py b/httprunner/runner.py similarity index 98% rename from ate/runner.py rename to httprunner/runner.py index 856654b5..9f11a4e4 100644 --- a/ate/runner.py +++ b/httprunner/runner.py @@ -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): diff --git a/ate/task.py b/httprunner/task.py similarity index 97% rename from ate/task.py rename to httprunner/task.py index e35c361a..4125a818 100644 --- a/ate/task.py +++ b/httprunner/task.py @@ -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): diff --git a/ate/testcase.py b/httprunner/testcase.py similarity index 99% rename from ate/testcase.py rename to httprunner/testcase.py index da2f04af..33dc9cee 100644 --- a/ate/testcase.py +++ b/httprunner/testcase.py @@ -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_ =,]*\))\}" diff --git a/ate/utils.py b/httprunner/utils.py similarity index 99% rename from ate/utils.py rename to httprunner/utils.py index e0554168..2a82279b 100644 --- a/ate/utils.py +++ b/httprunner/utils.py @@ -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: diff --git a/main-ate.py b/main-ate.py index 4146b317..dbebf9df 100644 --- a/main-ate.py +++ b/main-ate.py @@ -1,5 +1,5 @@ """ used for debugging """ -from ate.cli import main_ate +from httprunner.cli import main_ate main_ate() diff --git a/main-locust.py b/main-locust.py index e85d4410..ea79ce4d 100644 --- a/main-locust.py +++ b/main-locust.py @@ -1,5 +1,5 @@ """ used for debugging """ -from ate.cli import main_locust +from httprunner.cli import main_locust main_locust() diff --git a/setup.py b/setup.py index a9d20197..58378073 100644 --- a/setup.py +++ b/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' ] } ) diff --git a/tests/api_server.py b/tests/api_server.py index 8517dc70..ae57c000 100644 --- a/tests/api_server.py +++ b/tests/api_server.py @@ -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__) diff --git a/tests/base.py b/tests/base.py index aa9d1b70..cf5d8533 100644 --- a/tests/base.py +++ b/tests/base.py @@ -3,7 +3,7 @@ import time import unittest import requests -from ate import utils +from httprunner import utils from tests import api_server diff --git a/tests/test_client.py b/tests/test_client.py index bd169f26..1c24557a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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): diff --git a/tests/test_context.py b/tests/test_context.py index d56f6bdf..413654d3 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -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): diff --git a/tests/test_response.py b/tests/test_response.py index cce3aca8..97680553 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -1,5 +1,5 @@ import requests -from ate import response, exception +from httprunner import response, exception from tests.base import ApiServerUnittest class TestResponse(ApiServerUnittest): diff --git a/tests/test_runner.py b/tests/test_runner.py index f2d8e684..d8f3d82e 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -1,6 +1,6 @@ import os -from ate import exception, runner, testcase +from httprunner import exception, runner, testcase from tests.base import ApiServerUnittest diff --git a/tests/test_task.py b/tests/test_task.py index 61fe7f9e..9f51fec3 100644 --- a/tests/test_task.py +++ b/tests/test_task.py @@ -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 diff --git a/tests/test_testcase.py b/tests/test_testcase.py index 10d752d6..d9359061 100644 --- a/tests/test_testcase.py +++ b/tests/test_testcase.py @@ -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): diff --git a/tests/test_utils.py b/tests/test_utils.py index bc546e5d..f68ff4b2 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -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")