{ "info": { "author": "Adol liu", "author_email": "34862933@qq.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "# About\nA basic library could decrease the workload.Most of the problem solved in a real testing job.\n# Function info\n## interface test\n> parameter template \nurl = \"https://test/api/log?requestID=testid&clientToken=testtoken\" body ={\"date\": \"2018-11-04 10:10:10\", \"actions\": [{\"actionTime\": 1542248466944,\"note\"]}}\n### interface basic verification\n---\n verification of the value of parameter is null\n---\nverification of the parameter in a GET method restful interface link, such as requestID: \n>url = \"https://test/api/log?requestID=&clientToken=testtoken\"\n\nverification of request body in a POST restful interface, type of the body, such as form or raw will self adapted.\ne.g\n>body ={\"date\": \"\",\n\t\"actions\": [{\"actionTime\": 1542248466944,\"note\"]}}\n\n>body ={\"date\": \"2018-11-04 10:10:10\",\n\t\"actions\": [{\"actionTime\": \"\",\"note\"]}}\n\nthe value of parameter is \"\"\n----\n\tverification of null parameter\n----\n\nverification of the parameter in a GET method restful interface link, such as requestID: \n>url = \"https://test/api/log?clientToken=testtoken\"\n\nverification of request body in a POST restful interface, type of the body, such as form or raw will self adapted.\ne.g\n>body ={\n\t\"actions\": [{\"actionTime\": 1542248466944,\"note\"]}}\n\n>body ={\"date\": \"2018-11-04 10:10:10\",\n\t\"actions\": [{\"note\"]}}\n\n\tverification of length of parameter\n----\n range of the length is 1 to 100000\u3002\n\n----\n\n\n>performance test of interface\ncoming soon\nUI automatic test\n\n\n# how to install\n `pip install BlueTest`\n\nor\n\nhttps://pypi.org/project/BlueTest/\n\n# Usage and examples\n\n## example\n\n```python\n\u2514\u2500Project\n test1.py\n```\ntest1.py\uff1a\n```python\nimport BlueTest\nBlueTest.test()\n```\n---\n```python\n\u2514\u2500Project\n\u2502 test1.py\n\u251c\u2500log\n\u2502 all.log #log\n\u2502 error.log #error log\n\u251c\u2500result #reuslt\n\u2502 data.txt\n\u2514\u2500srcdata\n \u2502 test.csv #postman serialize\n \u2502 test.json.postman_collection #postman example\n \u2514\u2500api #generated .py file according postman\n log.py\n```\n\n# \u7b80\u4ecb\n:waxing_gibbous_moon:\u51e0\u4e2a\u672c\u8d28\u61d2\u5230\u5bb6\uff0c\u5374\u88ab\u5de5\u4f5c\u538b\u8feb\u7684\u4eba\u3002\u4e3a\u4e86\u964d\u4f4e\u81ea\u5df1\u7684\u5de5\u4f5c\u91cf\uff0c\u62cd\u8111\u888b\u51b3\u5b9a\u7f16\u5199\u4e00\u4e2a\u8ba9\u5c0f\u767d\u4e5f\u53ef\u4ee5\u4f7f\u7528\u7684\u6d4b\u8bd5\u5e93\u3002\u4e00\u5207\u7684\u51fa\u53d1\u70b9\u90fd\u662f\u51e0\u4e2a\u61d2\u4eba\u5728\u5b9e\u9645\u5de5\u4f5c\u4e2d\u9047\u5230\u7684\u95ee\u9898\u548c\u573a\u666f\u3002\u505a\u8fd9\u4e00\u5207\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u5c11\u505a\u4e8b\u3002:waning_gibbous_moon:\n# \u529f\u80fd\u4ecb\u7ecd\n## \u63a5\u53e3\u6d4b\u8bd5\n> \u53c2\u6570\u6a21\u677f \u4e0b\u6587\u7684\u4ecb\u7ecd\u4e2d\u4f1a\u4f7f\u7528\u8be5\u6a21\u677f\u8fdb\u884c\u8bf4\u660e\nurl = \"https://test/api/log?requestID=testid&clientToken=testtoken\"\nbody ={\"date\": \"2018-11-04 10:10:10\",\n\t\"actions\": [{\"actionTime\": 1542248466944,\"note\"]}}\n\n----\n\n### \u63a5\u53e3\u57fa\u7840\u6821\u9a8c\n----\n\t\u53c2\u6570\u503c\u5224\u7a7a\u6821\u9a8c\n----\n\u94fe\u63a5\u4e2d\u7684\u53c2\u6570\u6821\u9a8c,\u5373\u4e00\u822c\u60c5\u51b5\u4e0bGET\u53c2\u6570\u7684\u6821\u9a8c,\u4ee5requestID\u4e3a\u4f8b:\n>url = \"https://test/api/log?requestID=&clientToken=testtoken\"\n\n\u8bf7\u6c42\u4e3b\u4f53\u53c2\u6570\u7684\u6821\u9a8c\uff0c\u5373\u4e00\u822c\u60c5\u51b5\u4e0bPOST\u53c2\u6570\u7684\u6821\u9a8c\uff0cform,raw\u7b49\u53c2\u6570\u7c7b\u578b\u5747\u81ea\u52a8\u5904\u7406\u3002\n\u4ee5body\u4e2d\u7684date\u4e3a\u4f8b\uff0c\u8bf7\u6c42\u53c2\u6570\u5982\u4e0b:\n>body ={\"date\": \"\",\n\t\"actions\": [{\"actionTime\": 1542248466944,\"note\"]}}\n\n\u4ee5body\u4e2d\u7684actions[0][actionTime]\u4e3a\u4f8b\uff0c\u8bf7\u6c42\u53c2\u6570\u5982\u4e0b:\n>body ={\"date\": \"2018-11-04 10:10:10\",\n\t\"actions\": [{\"actionTime\": \"\",\"note\"]}}\n\n\u7a7a\u503c\u4ee5\u7a7a\u5b57\u7b26\u4e32\u4e3a\u6807\u51c6\u3002\n\n----\n\t\u53c2\u6570\u5224\u7a7a\u6821\u9a8c\n----\n\u94fe\u63a5\u4e2d\u7684\u53c2\u6570\u6821\u9a8c,\u5373\u4e00\u822c\u60c5\u51b5\u4e0bGET\u53c2\u6570\u7684\u6821\u9a8c,\u4ee5requestID\u4e3a\u4f8b:\n>url = \"https://test/api/log?clientToken=testtoken\"\n\n\u8bf7\u6c42\u4e3b\u4f53\u53c2\u6570\u7684\u6821\u9a8c\uff0c\u5373\u4e00\u822c\u60c5\u51b5\u4e0bPOST\u53c2\u6570\u7684\u6821\u9a8c\uff0cform,raw\u7b49\u53c2\u6570\u7c7b\u578b\u5747\u81ea\u52a8\u5904\u7406\u3002\n\u4ee5body\u4e2d\u7684date\u4e3a\u4f8b\uff0c\u8bf7\u6c42\u53c2\u6570\u5982\u4e0b:\n>body ={\n\t\"actions\": [{\"actionTime\": 1542248466944,\"note\"]}}\n\n\u4ee5body\u4e2d\u7684actions[0][actionTime]\u4e3a\u4f8b\uff0c\u8bf7\u6c42\u53c2\u6570\u5982\u4e0b:\n>body ={\"date\": \"2018-11-04 10:10:10\",\n\t\"actions\": [{\"note\"]}}\n\n\t\u53c2\u6570\u957f\u5ea6\u6821\u9a8c\n----\n\u53c2\u6570\u957f\u5ea6\u6821\u9a8c\u8303\u56f4\u4e3a1-100000\u3002\n\n----\n\n\n>\u63a5\u53e3\u6027\u80fd\u6d4b\u8bd5\n\u5f85\u6dfb\u52a0\nUI\u81ea\u52a8\u5316\n\u529f\u80fd\u5df2\u5b9e\u73b0\uff0c\u8bf4\u660e\u5f85\u6dfb\u52a0\n\n# \u5b89\u88c5\u8bf4\u660e\n\u5b89\u88c5\u547d\u4ee4`pip install BlueTest`\n\nor\n\nhttps://pypi.org/project/BlueTest/\n\n# \u4f7f\u7528\u8bf4\u660e\u53ca\u8303\u4f8b\n\n## \u8303\u4f8b\n\n```python\n\u2514\u2500Project\n test1.py\n```\ntest1.py\uff1a\n```python\nimport BlueTest\nBlueTest.test()\n```\n---\n```python\n\u2514\u2500Project\n\u2502 test1.py\n\u251c\u2500log\n\u2502 all.log #\u65e5\u5fd7\n\u2502 error.log #\u9519\u8bef\u65e5\u5fd7\n\u251c\u2500result #\u7ed3\u679c\n\u2502 data.txt\n\u2514\u2500srcdata\n \u2502 test.csv #postman\u6587\u4ef6\u7684\u5e8f\u5217\u5316\n \u2502 test.json.postman_collection #\u8303\u4f8b\u7684postman\u6587\u4ef6\n \u2514\u2500api #\u6839\u636epostman\u751f\u6210\u7684\u76f8\u5173\u63a5\u53e3py\u6587\u4ef6\n log.py\n```\n\n## \u4f7f\u7528\u8bf4\u660e\n```python\nimport BlueTest\nBlueTest.initPostMan(\"test\") #\u6267\u884c\u5b8c\u6210\u4f1a\u751f\u6210\u76f8\u5e94csv\u6587\u4ef6\n#\u9ed8\u8ba4postamen\u6587\u4ef6\u8def\u5f84.//srcdata//name.json.collection\n#\u9ed8\u8ba4csv\u6587\u4ef6\u751f\u6210\u8def\u5f84.//srcdata//test.csv\nBlueTest.testByCsvData(\"test\") #\u6267\u884c\u5b8c\u6210\u4f1a\u751f\u6210\u76f8\u5e94\u7ed3\u679c\n#\u7ed3\u679c\u5305\u62ec \u65e5\u5fd7\u6587\u4ef6log \u7ed3\u679c\u6587\u4ef6resul\n```\n---\n```python\nBlueTest.initPostMan(\"test\") #\u6267\u884c\u5b8c\u6210\u4f1a\u751f\u6210\u76f8\u5e94csv\u6587\u4ef6\nBlueTest.initPostMan(\"test\",result_path=path) #\u6307\u5b9acsv\u6587\u4ef6\u751f\u6210\u8def\u5f84\n```\n\n```python\nBlueTest.testByCsvData(\"test\") #\u6267\u884c\u5b8c\u6210\u4f1a\u751f\u6210\u76f8\u5e94\u7ed3\u679c\nBlueTest.testByCsvData(\"test\",normal_test=True) #\u8fdb\u884c\u63a5\u53e3\u57fa\u7840\u9a8c\u8bc1\nBlueTest.testByCsvData(\"test\",normal_test=Fasle) #\u4e0d\u8fdb\u884c\u63a5\u53e3\u57fa\u7840\u9a8c\u8bc1\nBlueTest.testByCsvData(\"test\",mkpy=True) #\u751f\u6210\u63a5\u53e3py\u6587\u4ef6\u8303\u4f8b\u5982\u4e0b\n```\n---\n```python\nimport requests\nurl = \"https://nbrecsys.4paradigm.com/action/api/log\"\nquerystring = {'requestID': 'Abac6ban', 'clientToken': '1f9d3d10b0ab404e86c2e61a935d3888'}\npayload = {\"date\":\"2018-11-04 10:21:06\",\"actions\":[{\"requestID\":\"2222\",\"actionTime\":1542248466944,\"action\":\"show\",\"sceneId\":420,\"userId\":\"xubyCjC6zO\",\"itemId\":\"user_define\",\"itemSetId\":\"39\",\"uuid_tt_dd\":\"10_28867322960-222-222\",\"specialType\":\"csdn_net_alliance_ads\",\"ads\":1}]}\nheaders ={'Origin': ' https://blog.csdn.net',\n\t 'User-Agent': ' Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36',\n\t 'Content-Type': ' text/plain',\n\t 'Accept': ' */*',\n\t 'Referer': ' https://blog.csdn.net/qq_37159430/article/details/79970518',\n\t 'Accept-Encoding': ' gzip, deflate, br',\n\t 'Accept-Language': ' zh-CN,zh;q=0.8'}\nresponse = requests.request(\"POST\", url, params=querystring,data=payload,)\nprint(response.text)\n```\n\n\u5176\u4ed6\u529f\u80fd\u8be6\u89c1\u6e90\u7801 :gun:", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/liufeng3486/BluePlug.git", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "BluePlug", "package_url": "https://pypi.org/project/BluePlug/", "platform": "", "project_url": "https://pypi.org/project/BluePlug/", "project_urls": { "Homepage": "https://github.com/liufeng3486/BluePlug.git" }, "release_url": "https://pypi.org/project/BluePlug/0.0.4/", "requires_dist": null, "requires_python": ">=3.6.0", "summary": "Plug for all.", "version": "0.0.4" }, "last_serial": 4598428, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ab9a1931173f3a6037acafbfd5f1ff83", "sha256": "235809b8f87d85dfc0da73e44cb7b184380ef6a9891177136104adbc55fbe86a" }, "downloads": -1, "filename": "BluePlug-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ab9a1931173f3a6037acafbfd5f1ff83", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 26517, "upload_time": "2018-11-28T03:06:30", "url": "https://files.pythonhosted.org/packages/2f/3d/0ae7fa5631f4d43e6a476f7d5905b188609b55e237e7d56ce4287b3e08d8/BluePlug-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "a0342dc0e224a067d1a4f041f1fe6e4b", "sha256": "49e0b546e2c8da22e6a29a894818ad735727a20b30ccbcf7b7d478062bf489cb" }, "downloads": -1, "filename": "BluePlug-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a0342dc0e224a067d1a4f041f1fe6e4b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 26555, "upload_time": "2018-11-28T05:53:39", "url": "https://files.pythonhosted.org/packages/7a/18/bd41704c7233566b9a109e0b93bff1f9acb99b8bb7a7ccdca83ae3f8c0aa/BluePlug-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "310a16d252c235ea1d78cb1dc4a0ae58", "sha256": "9d478deb234c03e2522d17114f3f97a63fdc4f9c797da4ecec9fe6896ffd16c1" }, "downloads": -1, "filename": "BluePlug-0.0.3.tar.gz", "has_sig": false, "md5_digest": "310a16d252c235ea1d78cb1dc4a0ae58", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 27298, "upload_time": "2018-12-13T09:01:12", "url": "https://files.pythonhosted.org/packages/2a/b0/011d6e7defefa91b34dc4057e122e61120115e1183e47f7db5a1d0173927/BluePlug-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "305899d04fff93db2cc2aa3010ff5fc9", "sha256": "2746966e48f00c155e0b898cf5df0f6c2058d3fb0923060c886674c3a2d93d9c" }, "downloads": -1, "filename": "BluePlug-0.0.4.tar.gz", "has_sig": false, "md5_digest": "305899d04fff93db2cc2aa3010ff5fc9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 27732, "upload_time": "2018-12-14T08:16:33", "url": "https://files.pythonhosted.org/packages/f6/09/6e38e32751e2746f5c3b1712ebe823cdd4d78c3c97f0e3d354f6e46c6a86/BluePlug-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "305899d04fff93db2cc2aa3010ff5fc9", "sha256": "2746966e48f00c155e0b898cf5df0f6c2058d3fb0923060c886674c3a2d93d9c" }, "downloads": -1, "filename": "BluePlug-0.0.4.tar.gz", "has_sig": false, "md5_digest": "305899d04fff93db2cc2aa3010ff5fc9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 27732, "upload_time": "2018-12-14T08:16:33", "url": "https://files.pythonhosted.org/packages/f6/09/6e38e32751e2746f5c3b1712ebe823cdd4d78c3c97f0e3d354f6e46c6a86/BluePlug-0.0.4.tar.gz" } ] }