api-nichotined-1.1.1


توضیحات

API package for testing purpose
ویژگی مقدار
سیستم عامل OS Independent
نام فایل api-nichotined-1.1.1
نام api-nichotined
نسخه کتابخانه 1.1.1
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Nicholas Frederick
ایمیل نویسنده nicholas.frederich.lagaunne@gmail.com
آدرس صفحه اصلی https://github.com/nichotined/api
آدرس اینترنتی https://pypi.org/project/api-nichotined/
مجوز -
# API This package is used for REST API classbased, author used it for API flow testing. JSON body response will be converted to python data type. Made it easier for you to use. > This package is extending python requests library https://github.com/requests/requests/ How to install ``` $ pip3 install api-nichotined ``` How to distribute to pypi ``` $ python setup.py sdist bdist_wheel && python -m twine upload dist/* ``` Usage example ```python3 from API import Get, Post from import_file import host post_body = { "name": "Nicholas Frederick" } class GetRequest(Get): def __init__(self, latitude: str, longitude: str): super().__init__() self.url = "{0}/dummy?latitude={1}&longitude={2}".format(host["serviceHost"], latitude, longitude) self.headers = { "Content-Type": "application/json", "Authorization": "TOKEN" } self.execute() class PostRequest(Post): def __init__(self, body: Data): super().__init__() self.url = "{0}/dummy".format(host['serviceHost']) self.headers = { "Content-Type": "application/json", "Authorization": "TOKEN" } self.json = body self.execute() if __name__ == "__main__": get_data = GetRequest('106', '80') post_data = PostRequest(post_body) assert get_data.address_name == "somewhere" assert post_data.status_code == 200 ``` Mocker usage Beforehand, edit or extend `mocker.py` and add your desired response on that file. ``` $ mitmproxy -p 8888 -s API/modules/mocker/mocker.py ```


نیازمندی

مقدار نام
- requests
- pytest
- redis
- curlify
- mitmproxy


نحوه نصب


نصب پکیج whl api-nichotined-1.1.1:

    pip install api-nichotined-1.1.1.whl


نصب پکیج tar.gz api-nichotined-1.1.1:

    pip install api-nichotined-1.1.1.tar.gz