diff --git a/.gitignore b/.gitignore index 08b241db25..7c79aacb6e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ node_modules .npm +/tests/build/ /examples/BOOTH1/converted/ bzt/resources/NUnitRunner/* diff --git a/.travis.yml b/.travis.yml index deaca9fc7a..dbd7651587 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ matrix: - PYTHON=python3 - PIP_INSTALL="sudo pip3 install" - RVM_KEY="409B6B1796C275462A1703113804BB82D39DC0E3" - - OSX_EXCLUDE="--exclude-test=tests.modules.selenium.test_csharp" + - OSX_EXCLUDE="--exclude-test=tests.unit.modules.selenium.test_csharp" addons: firefox: latest diff --git a/profiled-test.sh b/profiled-test.sh index 31ab814e5b..166c6f8dd8 100755 --- a/profiled-test.sh +++ b/profiled-test.sh @@ -1,3 +1,3 @@ #!/bin/bash -x -python -m cProfile -o /tmp/taurus.profile `which nosetests` --nologcapture tests.modules.test_external:TestExternalResultsLoader.test_errors_jtl2 +python -m cProfile -o /tmp/taurus.profile `which nosetests` --nologcapture tests.unit.modules.test_external:TestExternalResultsLoader.test_errors_jtl2 python -m gprof2dot -f pstats /tmp/taurus.profile | dot -Tpng -o /tmp/profile.png \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index a37ea385b1..0000000000 --- a/tests/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -""" unit test """ -from tests.base import TEST_DIR, BUILD_DIR, RESOURCES_DIR, BASE_CONFIG, ROOT_LOGGER -from tests.base import close_reader_file, local_paths_config, get_cwd -from tests.cases import BZTestCase, ExecutorTestCase -from tests.mocks import random_datapoint diff --git a/tests/resources/apiritif/transactions.ldjson b/tests/resources/apiritif/transactions.ldjson index 05e112c335..19254dfa03 100644 --- a/tests/resources/apiritif/transactions.ldjson +++ b/tests/resources/apiritif/transactions.ldjson @@ -1,8 +1,8 @@ -{"status": "PASSED", "start_time": 1524473357.366692, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473357.557643, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.189823, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_1_single_request"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "test_1_single_request", "extras": {"responseTime": 189, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 189, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff1374bd154e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "OK"}}], "assertions": [], "duration": 0.19100689888000488, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_1_single_request"}], "error_msg": null, "test_case": "test_1_single_request", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.test_transactions.TestRequests.test_1_single_request", "description": null}} -{"status": "PASSED", "start_time": 1524473357.558203, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473357.578403, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.018172, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_2_multiple_requests"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "test_2_multiple_requests", "extras": {"responseTime": 18, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 18, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff1374dd244e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473357.957092, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.378188, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_2_multiple_requests"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "test_2_multiple_requests", "extras": {"responseTime": 378, "responseHeadersSize": 707, "requestHeadersSize": 20, "responseSize": 2, "latency": 378, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "EXPIRED", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff1374fd2e4e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.3989269733428955, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_2_multiple_requests"}], "error_msg": null, "test_case": "test_2_multiple_requests", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.test_transactions.TestRequests.test_2_multiple_requests", "description": null}} -{"status": "PASSED", "start_time": 1524473357.95782, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473357.957891, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473357.978153, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.018789, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_3_toplevel_transaction"}, {"type": "transaction", "value": "Transaction"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "Transaction", "extras": {"responseTime": 18, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 18, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff13775df14e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473357.99819, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.019595, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_3_toplevel_transaction"}, {"type": "transaction", "value": "Transaction"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "Transaction", "extras": {"responseTime": 19, "responseHeadersSize": 703, "requestHeadersSize": 20, "responseSize": 2, "latency": 19, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff13777e034e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.04031205177307129, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_3_toplevel_transaction"}, {"type": "transaction", "value": "Transaction"}], "error_msg": null, "test_case": "Transaction", "test_suite": "test_3_toplevel_transaction", "extras": {"responseTime": 40, "responseHeadersSize": 20, "requestHeadersSize": 20, "responseSize": 2, "latency": 40, "requestURI": "Transaction", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"User-Agent": "Apiritif"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.040411949157714844, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_3_toplevel_transaction"}], "error_msg": null, "test_case": "test_3_toplevel_transaction", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.test_transactions.TestRequests.test_3_toplevel_transaction", "description": null}} -{"status": "PASSED", "start_time": 1524473357.998822, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.017498, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.018039, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_4_mixed_transaction"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "test_4_mixed_transaction", "extras": {"responseTime": 18, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 18, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff13779e214e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473358.01751, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.035589, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.017642, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_4_mixed_transaction"}, {"type": "transaction", "value": "Transaction"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "Transaction", "extras": {"responseTime": 17, "responseHeadersSize": 703, "requestHeadersSize": 20, "responseSize": 2, "latency": 17, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff1377be294e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.01809215545654297, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_4_mixed_transaction"}, {"type": "transaction", "value": "Transaction"}], "error_msg": null, "test_case": "Transaction", "test_suite": "test_4_mixed_transaction", "extras": {"responseTime": 18, "responseHeadersSize": 20, "requestHeadersSize": 20, "responseSize": 2, "latency": 18, "requestURI": "Transaction", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"User-Agent": "Apiritif"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.03680610656738281, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_4_mixed_transaction"}], "error_msg": null, "test_case": "test_4_mixed_transaction", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.test_transactions.TestRequests.test_4_mixed_transaction", "description": null}} -{"status": "PASSED", "start_time": 1524473358.036187, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.036238, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.055563, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.017805, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 1"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "Transaction 1", "extras": {"responseTime": 17, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 17, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff1377de324e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473358.072818, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.016824, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 1"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "Transaction 1", "extras": {"responseTime": 16, "responseHeadersSize": 703, "requestHeadersSize": 20, "responseSize": 2, "latency": 16, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff1377fe3b4e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.03658795356750488, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 1"}], "error_msg": null, "test_case": "Transaction 1", "test_suite": "test_5_multiple_transactions", "extras": {"responseTime": 36, "responseHeadersSize": 20, "requestHeadersSize": 20, "responseSize": 2, "latency": 36, "requestURI": "Transaction 1", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"User-Agent": "Apiritif"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}, {"status": "PASSED", "start_time": 1524473358.072833, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.102096, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.027789, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 2"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "Transaction 2", "extras": {"responseTime": 27, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 27, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff13781e504e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473358.124293, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.021775, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 2"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "Transaction 2", "extras": {"responseTime": 21, "responseHeadersSize": 703, "requestHeadersSize": 20, "responseSize": 2, "latency": 21, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff13784e5d4e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.05147099494934082, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 2"}], "error_msg": null, "test_case": "Transaction 2", "test_suite": "test_5_multiple_transactions", "extras": {"responseTime": 51, "responseHeadersSize": 20, "requestHeadersSize": 20, "responseSize": 2, "latency": 51, "requestURI": "Transaction 2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"User-Agent": "Apiritif"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.08814215660095215, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}], "error_msg": null, "test_case": "test_5_multiple_transactions", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.test_transactions.TestRequests.test_5_multiple_transactions", "description": null}} -{"status": "PASSED", "start_time": 1524473358.125175, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.12524, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.5005810260772705, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_6_transaction_obj"}, {"type": "transaction", "value": "Label"}], "error_msg": null, "test_case": "Label", "test_suite": "test_6_transaction_obj", "extras": {"responseTime": 500, "responseHeadersSize": 0, "requestHeadersSize": 0, "responseSize": 0, "latency": 500, "requestURI": "Label", "responseBodySize": 0, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "", "requestCookiesRaw": "", "requestMethod": "", "assertions": [], "responseCode": null, "requestHeaders": {}, "requestCookiesSize": 0, "responseHeaders": {}, "requestSize": 0, "requestCookies": {}, "responseMessage": ""}}], "assertions": [], "duration": 0.500694990158081, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_6_transaction_obj"}], "error_msg": null, "test_case": "test_6_transaction_obj", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.test_transactions.TestRequests.test_6_transaction_obj", "description": null}} -{"status": "PASSED", "start_time": 1524473358.626357, "error_trace": null, "subsamples": [{"status": "FAILED", "start_time": 1524473358.626407, "error_trace": null, "subsamples": [], "assertions": [], "duration": 7.152557373046875e-06, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_7_transaction_fail"}, {"type": "transaction", "value": "Label"}], "error_msg": "Something went wrong", "test_case": "Label", "test_suite": "test_7_transaction_fail", "extras": {"responseTime": 0, "responseHeadersSize": 0, "requestHeadersSize": 0, "responseSize": 0, "latency": 0, "requestURI": "Label", "responseBodySize": 0, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "", "requestCookiesRaw": "", "requestMethod": "", "assertions": [], "responseCode": null, "requestHeaders": {}, "requestCookiesSize": 0, "responseHeaders": {}, "requestSize": 0, "requestCookies": {}, "responseMessage": ""}}], "assertions": [], "duration": 6.4849853515625e-05, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_7_transaction_fail"}], "error_msg": null, "test_case": "test_7_transaction_fail", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.test_transactions.TestRequests.test_7_transaction_fail", "description": null}} -{"status": "PASSED", "start_time": 1524473358.626646, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.6267, "error_trace": null, "subsamples": [], "assertions": [], "duration": 9.059906005859375e-06, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_8_transaction_attach"}, {"type": "transaction", "value": "Label"}], "error_msg": null, "test_case": "Label", "test_suite": "test_8_transaction_attach", "extras": {"assertions": [], "responseHeaders": {}, "requestSize": 0, "responseSize": 13, "latency": 0, "requestHeaders": {}, "responseBodySize": 13, "connectTime": 0, "requestBodySize": 12, "responseBody": "Response body", "requestCookiesRaw": "", "requestHeadersSize": 0, "responseHeadersSize": 0, "requestURI": "Label", "user": "YO", "responseTime": 0, "requestCookiesSize": 0, "requestCookies": {}, "requestBody": "Request body", "requestMethod": "", "responseMessage": "", "responseCode": 201}}], "assertions": [], "duration": 7.200241088867188e-05, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_8_transaction_attach"}], "error_msg": null, "test_case": "test_8_transaction_attach", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.test_transactions.TestRequests.test_8_transaction_attach", "description": null}} +{"status": "PASSED", "start_time": 1524473357.366692, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473357.557643, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.189823, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_1_single_request"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "test_1_single_request", "extras": {"responseTime": 189, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 189, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff1374bd154e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "OK"}}], "assertions": [], "duration": 0.19100689888000488, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_1_single_request"}], "error_msg": null, "test_case": "test_1_single_request", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.unit.test_transactions.TestRequests.test_1_single_request", "description": null}} +{"status": "PASSED", "start_time": 1524473357.558203, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473357.578403, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.018172, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_2_multiple_requests"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "test_2_multiple_requests", "extras": {"responseTime": 18, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 18, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff1374dd244e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473357.957092, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.378188, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_2_multiple_requests"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "test_2_multiple_requests", "extras": {"responseTime": 378, "responseHeadersSize": 707, "requestHeadersSize": 20, "responseSize": 2, "latency": 378, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "EXPIRED", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff1374fd2e4e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.3989269733428955, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_2_multiple_requests"}], "error_msg": null, "test_case": "test_2_multiple_requests", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.unit.test_transactions.TestRequests.test_2_multiple_requests", "description": null}} +{"status": "PASSED", "start_time": 1524473357.95782, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473357.957891, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473357.978153, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.018789, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_3_toplevel_transaction"}, {"type": "transaction", "value": "Transaction"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "Transaction", "extras": {"responseTime": 18, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 18, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff13775df14e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473357.99819, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.019595, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_3_toplevel_transaction"}, {"type": "transaction", "value": "Transaction"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "Transaction", "extras": {"responseTime": 19, "responseHeadersSize": 703, "requestHeadersSize": 20, "responseSize": 2, "latency": 19, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357; expires=Tue, 23-Apr-19 08:49:17 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:17 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:17 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff13777e034e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.04031205177307129, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_3_toplevel_transaction"}, {"type": "transaction", "value": "Transaction"}], "error_msg": null, "test_case": "Transaction", "test_suite": "test_3_toplevel_transaction", "extras": {"responseTime": 40, "responseHeadersSize": 20, "requestHeadersSize": 20, "responseSize": 2, "latency": 40, "requestURI": "Transaction", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=dc25336908c9394b4956b64fb0f8594591524473357", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"User-Agent": "Apiritif"}, "requestSize": 0, "requestCookies": {"__cfduid": "dc25336908c9394b4956b64fb0f8594591524473357"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.040411949157714844, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_3_toplevel_transaction"}], "error_msg": null, "test_case": "test_3_toplevel_transaction", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.unit.test_transactions.TestRequests.test_3_toplevel_transaction", "description": null}} +{"status": "PASSED", "start_time": 1524473357.998822, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.017498, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.018039, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_4_mixed_transaction"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "test_4_mixed_transaction", "extras": {"responseTime": 18, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 18, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff13779e214e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473358.01751, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.035589, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.017642, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_4_mixed_transaction"}, {"type": "transaction", "value": "Transaction"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "Transaction", "extras": {"responseTime": 17, "responseHeadersSize": 703, "requestHeadersSize": 20, "responseSize": 2, "latency": 17, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff1377be294e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.01809215545654297, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_4_mixed_transaction"}, {"type": "transaction", "value": "Transaction"}], "error_msg": null, "test_case": "Transaction", "test_suite": "test_4_mixed_transaction", "extras": {"responseTime": 18, "responseHeadersSize": 20, "requestHeadersSize": 20, "responseSize": 2, "latency": 18, "requestURI": "Transaction", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"User-Agent": "Apiritif"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.03680610656738281, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_4_mixed_transaction"}], "error_msg": null, "test_case": "test_4_mixed_transaction", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.unit.test_transactions.TestRequests.test_4_mixed_transaction", "description": null}} +{"status": "PASSED", "start_time": 1524473358.036187, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.036238, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.055563, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.017805, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 1"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "Transaction 1", "extras": {"responseTime": 17, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 17, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff1377de324e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473358.072818, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.016824, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 1"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "Transaction 1", "extras": {"responseTime": 16, "responseHeadersSize": 703, "requestHeadersSize": 20, "responseSize": 2, "latency": 16, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff1377fe3b4e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.03658795356750488, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 1"}], "error_msg": null, "test_case": "Transaction 1", "test_suite": "test_5_multiple_transactions", "extras": {"responseTime": 36, "responseHeadersSize": 20, "requestHeadersSize": 20, "responseSize": 2, "latency": 36, "requestURI": "Transaction 1", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"User-Agent": "Apiritif"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}, {"status": "PASSED", "start_time": 1524473358.072833, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.102096, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.027789, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 2"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/", "test_suite": "Transaction 2", "extras": {"responseTime": 27, "responseHeadersSize": 661, "requestHeadersSize": 20, "responseSize": 6301, "latency": 27, "requestURI": "https://jsonplaceholder.typicode.com/", "responseBodySize": 6301, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "\n\n\n\nJSONPlaceholder - Fake online REST API for developers\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n\n
JSONPlaceholder\n

\n

\nFake Online REST API for Testing and Prototyping\n
\n\npowered by\nJSON Server\nand\nlowdb\n\n

\n
\n
\n
\n\nSee also\n Fast, easy and reliable testing for anything that runs in a browser.\n
\n
\n
\n\n

Intro

\n

\nJSONPlaceholder is a free online REST service that you can use whenever you need some fake data.\n

\n

\nIt's great for tutorials, faking a server, sharing code examples, ...\n

\n

Example

\n

\nRun this code in a console or from anywhere.\n
HTTP and HTTPS are both supported.\n

\n
fetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(response => response.json())\n  .then(json => console.log(json))\n
\n

\n\n

\n

// click the button above to make a request ;)

\n

Resources

\n

\nInspired by common use cases.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n/posts\n100 items
\n/comments\n500 items
\n/albums\n100 items
\n/photos\n5000 items
\n/todos\n200 items
\n/users\n10 items
\n

Routes

\n

\nAll HTTP verbs are supported.\n
View usage\nexamples.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
GET\n/posts\n
GET\n/posts/1\n
GET\n/posts/1/comments\n
GET\n/comments?postId=1\n
GET\n/posts?userId=1\n
POST/posts
PUT/posts/1
PATCH/posts/1
DELETE/posts/1
\n

Use your OWN data

\n

\nJSON Server powers this website. You can use it to create the same fake API in less than\n30 seconds with your own data.\n

\n
npm install -g json-server
\n

Or you can try\nMy JSON Server free service.

\n
\n\n
\n
\n\n\n\n\n\n\n\n\n\n", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 200, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Via": "1.1 vegur", "X-Powered-By": "Express", "Transfer-Encoding": "chunked", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Last-Modified": "Sun, 28 Jan 2018 23:17:34 GMT", "Connection": "keep-alive", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "text/html; charset=UTF-8", "CF-RAY": "40ff13781e504e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "OK"}}, {"status": "PASSED", "start_time": 1524473358.124293, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.021775, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 2"}, {"type": "request", "value": "https://jsonplaceholder.typicode.com/2"}], "error_msg": null, "test_case": "https://jsonplaceholder.typicode.com/2", "test_suite": "Transaction 2", "extras": {"responseTime": 21, "responseHeadersSize": 703, "requestHeadersSize": 20, "responseSize": 2, "latency": 21, "requestURI": "https://jsonplaceholder.typicode.com/2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "Content-Length": "2", "Via": "1.1 vegur", "X-Content-Type-Options": "nosniff", "X-Powered-By": "Express", "Set-Cookie": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358; expires=Tue, 23-Apr-19 08:49:18 GMT; path=/; domain=.typicode.com; HttpOnly", "CF-Cache-Status": "HIT", "Expires": "Mon, 23 Apr 2018 12:49:18 GMT", "Vary": "Origin, Accept-Encoding", "Server": "cloudflare", "Connection": "keep-alive", "Etag": "W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"", "Pragma": "no-cache", "Cache-Control": "public, max-age=14400", "Date": "Mon, 23 Apr 2018 08:49:18 GMT", "Access-Control-Allow-Credentials": "true", "Content-Type": "application/json; charset=utf-8", "CF-RAY": "40ff13784e5d4e0c-DME"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.05147099494934082, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}, {"type": "transaction", "value": "Transaction 2"}], "error_msg": null, "test_case": "Transaction 2", "test_suite": "test_5_multiple_transactions", "extras": {"responseTime": 51, "responseHeadersSize": 20, "requestHeadersSize": 20, "responseSize": 2, "latency": 51, "requestURI": "Transaction 2", "responseBodySize": 2, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "{}", "requestCookiesRaw": "__cfduid=d57ed9f4c67ff93c5e70288846dd719e61524473358", "requestMethod": "GET", "assertions": [], "responseCode": 404, "requestHeaders": {"User-Agent": "Apiritif"}, "requestCookiesSize": 52, "responseHeaders": {"User-Agent": "Apiritif"}, "requestSize": 0, "requestCookies": {"__cfduid": "d57ed9f4c67ff93c5e70288846dd719e61524473358"}, "responseMessage": "Not Found"}}], "assertions": [], "duration": 0.08814215660095215, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_5_multiple_transactions"}], "error_msg": null, "test_case": "test_5_multiple_transactions", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.unit.test_transactions.TestRequests.test_5_multiple_transactions", "description": null}} +{"status": "PASSED", "start_time": 1524473358.125175, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.12524, "error_trace": null, "subsamples": [], "assertions": [], "duration": 0.5005810260772705, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_6_transaction_obj"}, {"type": "transaction", "value": "Label"}], "error_msg": null, "test_case": "Label", "test_suite": "test_6_transaction_obj", "extras": {"responseTime": 500, "responseHeadersSize": 0, "requestHeadersSize": 0, "responseSize": 0, "latency": 500, "requestURI": "Label", "responseBodySize": 0, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "", "requestCookiesRaw": "", "requestMethod": "", "assertions": [], "responseCode": null, "requestHeaders": {}, "requestCookiesSize": 0, "responseHeaders": {}, "requestSize": 0, "requestCookies": {}, "responseMessage": ""}}], "assertions": [], "duration": 0.500694990158081, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_6_transaction_obj"}], "error_msg": null, "test_case": "test_6_transaction_obj", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.unit.test_transactions.TestRequests.test_6_transaction_obj", "description": null}} +{"status": "PASSED", "start_time": 1524473358.626357, "error_trace": null, "subsamples": [{"status": "FAILED", "start_time": 1524473358.626407, "error_trace": null, "subsamples": [], "assertions": [], "duration": 7.152557373046875e-06, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_7_transaction_fail"}, {"type": "transaction", "value": "Label"}], "error_msg": "Something went wrong", "test_case": "Label", "test_suite": "test_7_transaction_fail", "extras": {"responseTime": 0, "responseHeadersSize": 0, "requestHeadersSize": 0, "responseSize": 0, "latency": 0, "requestURI": "Label", "responseBodySize": 0, "connectTime": 0, "requestBodySize": 0, "requestBody": "", "responseBody": "", "requestCookiesRaw": "", "requestMethod": "", "assertions": [], "responseCode": null, "requestHeaders": {}, "requestCookiesSize": 0, "responseHeaders": {}, "requestSize": 0, "requestCookies": {}, "responseMessage": ""}}], "assertions": [], "duration": 6.4849853515625e-05, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_7_transaction_fail"}], "error_msg": null, "test_case": "test_7_transaction_fail", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.unit.test_transactions.TestRequests.test_7_transaction_fail", "description": null}} +{"status": "PASSED", "start_time": 1524473358.626646, "error_trace": null, "subsamples": [{"status": "PASSED", "start_time": 1524473358.6267, "error_trace": null, "subsamples": [], "assertions": [], "duration": 9.059906005859375e-06, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_8_transaction_attach"}, {"type": "transaction", "value": "Label"}], "error_msg": null, "test_case": "Label", "test_suite": "test_8_transaction_attach", "extras": {"assertions": [], "responseHeaders": {}, "requestSize": 0, "responseSize": 13, "latency": 0, "requestHeaders": {}, "responseBodySize": 13, "connectTime": 0, "requestBodySize": 12, "responseBody": "Response body", "requestCookiesRaw": "", "requestHeadersSize": 0, "responseHeadersSize": 0, "requestURI": "Label", "user": "YO", "responseTime": 0, "requestCookiesSize": 0, "requestCookies": {}, "requestBody": "Request body", "requestMethod": "", "responseMessage": "", "responseCode": 201}}], "assertions": [], "duration": 7.200241088867188e-05, "path": [{"type": "package", "value": "tests"}, {"type": "module", "value": "test_transactions"}, {"type": "class", "value": "TestRequests"}, {"type": "method", "value": "test_8_transaction_attach"}], "error_msg": null, "test_case": "test_8_transaction_attach", "test_suite": "TestRequests", "extras": {"assertions": [], "file": "/home/dmand/src/apiritif/tests/test_transactions.py", "full_name": "tests.unit.test_transactions.TestRequests.test_8_transaction_attach", "description": null}} diff --git a/tests/resources/json/mock_end_err.json b/tests/resources/json/mock_end_err.json index 135e53cb8b..76851f7c3b 100644 --- a/tests/resources/json/mock_end_err.json +++ b/tests/resources/json/mock_end_err.json @@ -2,8 +2,8 @@ "provisioning": "mock1", "modules": { "mock1": { - "class": "tests.mocks.ModuleMock", - "shutdown": "tests.mocks.KeyboardInterrupt" + "class": "tests.unit.mocks.ModuleMock", + "shutdown": "tests.unit.mocks.KeyboardInterrupt" } } } \ No newline at end of file diff --git a/tests/resources/json/mock_normal.json b/tests/resources/json/mock_normal.json index 916765e7ca..8daa9769c7 100644 --- a/tests/resources/json/mock_normal.json +++ b/tests/resources/json/mock_normal.json @@ -13,10 +13,10 @@ } ], "modules": { - "mock1": {"class": "tests.mocks.ModuleMock"}, - "mock2": "tests.mocks.ModuleMock", - "mock3": "tests.mocks.ModuleMock", - "mock4": "tests.mocks.ModuleMock" + "mock1": {"class": "tests.unit.mocks.ModuleMock"}, + "mock2": "tests.unit.mocks.ModuleMock", + "mock3": "tests.unit.mocks.ModuleMock", + "mock4": "tests.unit.mocks.ModuleMock" }, "test": [ 1, diff --git a/tests/resources/json/mock_postproc_err.json b/tests/resources/json/mock_postproc_err.json index 32af5ab8cb..cef79b2d9c 100644 --- a/tests/resources/json/mock_postproc_err.json +++ b/tests/resources/json/mock_postproc_err.json @@ -2,7 +2,7 @@ "provisioning": "mock1", "modules": { "mock1": { - "class": "tests.mocks.ModuleMock", + "class": "tests.unit.mocks.ModuleMock", "postproc": "bzt.AutomatedShutdown" } } diff --git a/tests/resources/json/mock_prepare_err.json b/tests/resources/json/mock_prepare_err.json index 95cc1bb0cd..6f3493ec69 100644 --- a/tests/resources/json/mock_prepare_err.json +++ b/tests/resources/json/mock_prepare_err.json @@ -2,8 +2,8 @@ "provisioning": "mock1", "modules": { "mock1": { - "class": "tests.mocks.ModuleMock", - "prepare": "tests.mocks.KeyboardInterrupt" + "class": "tests.unit.mocks.ModuleMock", + "prepare": "tests.unit.mocks.KeyboardInterrupt" } } } \ No newline at end of file diff --git a/tests/resources/json/mock_start_err.json b/tests/resources/json/mock_start_err.json index 02beaa9429..048b67960d 100644 --- a/tests/resources/json/mock_start_err.json +++ b/tests/resources/json/mock_start_err.json @@ -2,8 +2,8 @@ "provisioning": "mock1", "modules": { "mock1": { - "class": "tests.mocks.ModuleMock", - "startup": "tests.mocks.KeyboardInterrupt" + "class": "tests.unit.mocks.ModuleMock", + "startup": "tests.unit.mocks.KeyboardInterrupt" } } } \ No newline at end of file diff --git a/tests/resources/json/mock_wait_err.json b/tests/resources/json/mock_wait_err.json index 9fa9f48cfe..7618645557 100644 --- a/tests/resources/json/mock_wait_err.json +++ b/tests/resources/json/mock_wait_err.json @@ -2,8 +2,8 @@ "provisioning": "mock", "modules": { "mock": { - "class": "tests.mocks.ModuleMock", - "check": "tests.mocks.KeyboardInterrupt" + "class": "tests.unit.mocks.ModuleMock", + "check": "tests.unit.mocks.KeyboardInterrupt" } } } \ No newline at end of file diff --git a/tests/resources/json/reporting.json b/tests/resources/json/reporting.json index d3985f84e5..4b935da80b 100644 --- a/tests/resources/json/reporting.json +++ b/tests/resources/json/reporting.json @@ -7,7 +7,7 @@ ], "modules": { "mock": { - "class": "tests.mocks.ModuleMock", + "class": "tests.unit.mocks.ModuleMock", "check_iterations": 30 }, "console": { diff --git a/tests/resources/yaml/singletone-service.yml b/tests/resources/yaml/singletone-service.yml index 7456946651..8cc10e6428 100644 --- a/tests/resources/yaml/singletone-service.yml +++ b/tests/resources/yaml/singletone-service.yml @@ -17,4 +17,4 @@ reporting: modules: singletone-mock: - class: tests.mocks.SingletoneServiceMock \ No newline at end of file + class: tests.unit.mocks.SingletoneServiceMock \ No newline at end of file diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000000..ad7c5a28f1 --- /dev/null +++ b/tests/unit/__init__.py @@ -0,0 +1,5 @@ +""" unit test """ +from tests.unit.base import TEST_DIR, BUILD_DIR, RESOURCES_DIR, BASE_CONFIG, ROOT_LOGGER, BZT_DIR +from tests.unit.base import close_reader_file, local_paths_config +from tests.unit.mocks import random_datapoint, EngineEmul, BZMock +from tests.unit.cases import BZTestCase, ExecutorTestCase diff --git a/tests/base.py b/tests/unit/base.py similarity index 73% rename from tests/base.py rename to tests/unit/base.py index c19bccec2f..8967c95649 100644 --- a/tests/base.py +++ b/tests/unit/base.py @@ -3,27 +3,25 @@ import os import logging -from bzt.utils import temp_file +from bzt.cli import CLI +from bzt.utils import EXE_SUFFIX, run_once, temp_file, get_full_path ROOT_LOGGER = logging.getLogger("") -def get_cwd(): +def _get_dir(): filename = inspect.getouterframes(inspect.currentframe())[1][1] - return os.path.dirname(filename) + return get_full_path(filename, step_up=1) # execute tests regardless of working directory -root_dir = get_cwd() + '/../' -os.chdir(root_dir) - -RESOURCES_DIR = os.path.join(get_cwd(), 'resources') + os.path.sep -BUILD_DIR = get_cwd() + "/../build/tmp/" -TEST_DIR = get_cwd() + "/../build/test/" -BASE_CONFIG = get_cwd() + "/../bzt/resources/10-base-config.yml" +BZT_DIR = get_full_path(_get_dir(), step_up=2) +RESOURCES_DIR = os.path.join(BZT_DIR, 'tests', 'resources') + os.path.sep # we need this sep cos a lot of +BUILD_DIR = os.path.join(BZT_DIR, 'tests', 'build', 'tmp') + os.path.sep # wrong sting joining in tests +TEST_DIR = os.path.join(BZT_DIR, 'tests', 'build', 'test') + os.path.sep +BASE_CONFIG = os.path.join(BZT_DIR, 'bzt', 'resources', '10-base-config.yml') -from bzt.cli import CLI -from bzt.utils import EXE_SUFFIX, run_once +os.chdir(BZT_DIR) @run_once diff --git a/tests/bza_client_example.py b/tests/unit/bza_client_example.py similarity index 100% rename from tests/bza_client_example.py rename to tests/unit/bza_client_example.py diff --git a/tests/cases.py b/tests/unit/cases.py similarity index 98% rename from tests/cases.py rename to tests/unit/cases.py index 463441d158..6613ffcc20 100644 --- a/tests/cases.py +++ b/tests/unit/cases.py @@ -10,8 +10,7 @@ from bzt.engine import ScenarioExecutor, EXEC from bzt.engine import SelfDiagnosable from bzt.utils import get_full_path -from tests import ROOT_LOGGER -from tests.mocks import EngineEmul +from tests.unit import ROOT_LOGGER, EngineEmul TestCase.shortDescription = lambda self: None # suppress nose habit to show docstring instead of method name diff --git a/tests/mocks.py b/tests/unit/mocks.py similarity index 99% rename from tests/mocks.py rename to tests/unit/mocks.py index 1bf7fde0cf..c625113464 100644 --- a/tests/mocks.py +++ b/tests/unit/mocks.py @@ -16,7 +16,7 @@ from bzt.modules.functional import FunctionalResultsReader, FunctionalAggregatorListener from bzt.utils import b, load_class, to_json, get_full_path, get_uniq_name, FileReader, is_windows, temp_file -from tests.base import TEST_DIR, ROOT_LOGGER +from tests.unit.base import TEST_DIR, ROOT_LOGGER try: from exceptions import KeyboardInterrupt diff --git a/tests/modules/__init__.py b/tests/unit/modules/__init__.py similarity index 100% rename from tests/modules/__init__.py rename to tests/unit/modules/__init__.py diff --git a/tests/modules/jmeter/__init__.py b/tests/unit/modules/jmeter/__init__.py similarity index 100% rename from tests/modules/jmeter/__init__.py rename to tests/unit/modules/jmeter/__init__.py diff --git a/tests/modules/jmeter/test_JMX.py b/tests/unit/modules/jmeter/test_JMX.py similarity index 99% rename from tests/modules/jmeter/test_JMX.py rename to tests/unit/modules/jmeter/test_JMX.py index c08d55ebea..8594fd3b09 100644 --- a/tests/modules/jmeter/test_JMX.py +++ b/tests/unit/modules/jmeter/test_JMX.py @@ -2,8 +2,7 @@ from . import MockJMeterExecutor from bzt.engine import Provisioning from bzt.jmx import JMX, LoadSettingsProcessor -from tests import BZTestCase, RESOURCES_DIR -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, RESOURCES_DIR, EngineEmul class TestLoadSettingsProcessor(BZTestCase): diff --git a/tests/modules/jmeter/test_JMeterExecutor.py b/tests/unit/modules/jmeter/test_JMeterExecutor.py similarity index 99% rename from tests/modules/jmeter/test_JMeterExecutor.py rename to tests/unit/modules/jmeter/test_JMeterExecutor.py index 5ce7b49ff1..59cdacb09c 100644 --- a/tests/modules/jmeter/test_JMeterExecutor.py +++ b/tests/unit/modules/jmeter/test_JMeterExecutor.py @@ -17,7 +17,7 @@ from bzt.modules.jmeter import JTLReader, FuncJTLReader, JMeter from bzt.modules.provisioning import Local from bzt.utils import EXE_SUFFIX, get_full_path, BetterDict, is_windows, JavaVM, etree -from tests import RESOURCES_DIR, BUILD_DIR, close_reader_file, ExecutorTestCase +from tests.unit import RESOURCES_DIR, BUILD_DIR, close_reader_file, ExecutorTestCase from . import MockJMeterExecutor, MockHTTPClient _jvm = JavaVM() diff --git a/tests/modules/jmeter/test_JMeterTool.py b/tests/unit/modules/jmeter/test_JMeterTool.py similarity index 97% rename from tests/modules/jmeter/test_JMeterTool.py rename to tests/unit/modules/jmeter/test_JMeterTool.py index 383887932c..9b3189b6dd 100644 --- a/tests/modules/jmeter/test_JMeterTool.py +++ b/tests/unit/modules/jmeter/test_JMeterTool.py @@ -2,7 +2,7 @@ from bzt.utils import EXE_SUFFIX from . import MockJMeter -from tests import BZTestCase, RESOURCES_DIR +from tests.unit import BZTestCase, RESOURCES_DIR class TestJMeterTool(BZTestCase): diff --git a/tests/modules/jmeter/test_JTLReader.py b/tests/unit/modules/jmeter/test_JTLReader.py similarity index 99% rename from tests/modules/jmeter/test_JTLReader.py rename to tests/unit/modules/jmeter/test_JTLReader.py index bc0ffb694b..dd65397e16 100644 --- a/tests/modules/jmeter/test_JTLReader.py +++ b/tests/unit/modules/jmeter/test_JTLReader.py @@ -8,8 +8,7 @@ from bzt.modules.aggregator import DataPoint, KPISet from bzt.modules.jmeter import JTLErrorsReader, JTLReader, FuncJTLReader from bzt.utils import to_json -from tests import BZTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER, EngineEmul class TestFuncJTLReader(BZTestCase): diff --git a/tests/modules/jmeter/test_ScenarioBuilder.py b/tests/unit/modules/jmeter/test_ScenarioBuilder.py similarity index 99% rename from tests/modules/jmeter/test_ScenarioBuilder.py rename to tests/unit/modules/jmeter/test_ScenarioBuilder.py index 514bb1f6df..ef321f6773 100644 --- a/tests/modules/jmeter/test_ScenarioBuilder.py +++ b/tests/unit/modules/jmeter/test_ScenarioBuilder.py @@ -3,8 +3,7 @@ from bzt.jmx.http import HTTPProtocolHandler from bzt.modules.jmeter import JMeterScenarioBuilder from bzt.utils import etree, temp_file -from tests import BZTestCase, RESOURCES_DIR -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, RESOURCES_DIR, EngineEmul from . import MockJMeterExecutor diff --git a/tests/modules/selenium/__init__.py b/tests/unit/modules/selenium/__init__.py similarity index 94% rename from tests/modules/selenium/__init__.py rename to tests/unit/modules/selenium/__init__.py index 5c5b0bed3b..a5aa044169 100644 --- a/tests/modules/selenium/__init__.py +++ b/tests/unit/modules/selenium/__init__.py @@ -1,4 +1,4 @@ -from tests import local_paths_config, ExecutorTestCase +from tests.unit import local_paths_config, ExecutorTestCase from bzt.modules.selenium import SeleniumExecutor from bzt.modules.services import VirtualDisplay diff --git a/tests/modules/selenium/test_apiritif_builder.py b/tests/unit/modules/selenium/test_apiritif_builder.py similarity index 99% rename from tests/modules/selenium/test_apiritif_builder.py rename to tests/unit/modules/selenium/test_apiritif_builder.py index ad02eff7b2..2e0ea52c97 100644 --- a/tests/modules/selenium/test_apiritif_builder.py +++ b/tests/unit/modules/selenium/test_apiritif_builder.py @@ -7,8 +7,7 @@ from bzt.modules.aggregator import DataPoint, KPISet from bzt.modules.apiritif import ApiritifNoseExecutor from bzt.modules.apiritif.executor import ApiritifLoadReader, ApiritifFuncReader -from tests import RESOURCES_DIR, ExecutorTestCase -from tests.mocks import EngineEmul +from tests.unit import RESOURCES_DIR, ExecutorTestCase, EngineEmul class TestApiritifScriptGeneration(ExecutorTestCase): diff --git a/tests/modules/selenium/test_csharp.py b/tests/unit/modules/selenium/test_csharp.py similarity index 92% rename from tests/modules/selenium/test_csharp.py rename to tests/unit/modules/selenium/test_csharp.py index 254720fc23..43d47d31ae 100644 --- a/tests/modules/selenium/test_csharp.py +++ b/tests/unit/modules/selenium/test_csharp.py @@ -3,8 +3,8 @@ from bzt.modules.csharp import NUnitExecutor from bzt.utils import is_windows -from tests import RESOURCES_DIR -from tests.modules.selenium import SeleniumTestCase +from tests.unit import RESOURCES_DIR +from tests.unit.modules.selenium import SeleniumTestCase RUNNER_EXECUTABLE = "runner-mock" + (".bat" if is_windows() else ".sh") diff --git a/tests/modules/selenium/test_java.py b/tests/unit/modules/selenium/test_java.py similarity index 99% rename from tests/modules/selenium/test_java.py rename to tests/unit/modules/selenium/test_java.py index 41b08d3111..4452cda50b 100644 --- a/tests/modules/selenium/test_java.py +++ b/tests/unit/modules/selenium/test_java.py @@ -13,9 +13,8 @@ from bzt.modules.jmeter import JTLReader from bzt.modules.selenium import SeleniumExecutor from bzt.utils import ToolError -from tests import BZTestCase, local_paths_config, RESOURCES_DIR, BUILD_DIR, ExecutorTestCase -from tests.mocks import EngineEmul -from tests.modules.selenium import SeleniumTestCase +from tests.unit import BZTestCase, local_paths_config, RESOURCES_DIR, BUILD_DIR, ExecutorTestCase, EngineEmul +from tests.unit.modules.selenium import SeleniumTestCase class TestTestNGTester(ExecutorTestCase): diff --git a/tests/modules/selenium/test_javascript.py b/tests/unit/modules/selenium/test_javascript.py similarity index 98% rename from tests/modules/selenium/test_javascript.py rename to tests/unit/modules/selenium/test_javascript.py index 44c7479aa7..0d3290818c 100644 --- a/tests/modules/selenium/test_javascript.py +++ b/tests/unit/modules/selenium/test_javascript.py @@ -10,9 +10,8 @@ from bzt.modules.javascript import NPMPackage, WebdriverIOExecutor, JavaScriptExecutor, NewmanExecutor, Mocha, JSSeleniumWebdriver from bzt.utils import get_full_path, EXE_SUFFIX -from tests import BUILD_DIR, RESOURCES_DIR, BZTestCase -from tests.mocks import EngineEmul -from tests.modules.selenium import SeleniumTestCase +from tests.unit import RESOURCES_DIR, BZTestCase, EngineEmul +from tests.unit.modules.selenium import SeleniumTestCase class TestSeleniumMochaRunner(SeleniumTestCase): diff --git a/tests/modules/selenium/test_python_executors.py b/tests/unit/modules/selenium/test_python_executors.py similarity index 99% rename from tests/modules/selenium/test_python_executors.py rename to tests/unit/modules/selenium/test_python_executors.py index a4587a711a..b2bb183e89 100644 --- a/tests/modules/selenium/test_python_executors.py +++ b/tests/unit/modules/selenium/test_python_executors.py @@ -15,8 +15,8 @@ from bzt.modules.apiritif import ApiritifNoseExecutor from bzt.modules.pytest import PyTestExecutor from bzt.modules.robot import RobotExecutor -from tests import RESOURCES_DIR, ExecutorTestCase, BZTestCase -from tests.modules.selenium import SeleniumTestCase +from tests.unit import RESOURCES_DIR, ExecutorTestCase, BZTestCase +from tests.unit.modules.selenium import SeleniumTestCase from bzt.resources.selenium_extras import get_locator, BYS from bzt.utils import EXE_SUFFIX diff --git a/tests/modules/selenium/test_ruby.py b/tests/unit/modules/selenium/test_ruby.py similarity index 97% rename from tests/modules/selenium/test_ruby.py rename to tests/unit/modules/selenium/test_ruby.py index e6bf424479..da813e069d 100644 --- a/tests/modules/selenium/test_ruby.py +++ b/tests/unit/modules/selenium/test_ruby.py @@ -3,8 +3,8 @@ import bzt from bzt.utils import EXE_SUFFIX -from tests import RESOURCES_DIR -from tests.modules.selenium import SeleniumTestCase +from tests.unit import RESOURCES_DIR +from tests.unit.modules.selenium import SeleniumTestCase class TestSeleniumRSpecRunner(SeleniumTestCase): diff --git a/tests/modules/selenium/test_selenium_builder.py b/tests/unit/modules/selenium/test_selenium_builder.py similarity index 99% rename from tests/modules/selenium/test_selenium_builder.py rename to tests/unit/modules/selenium/test_selenium_builder.py index 50109bc2d5..0a458e5ef7 100644 --- a/tests/modules/selenium/test_selenium_builder.py +++ b/tests/unit/modules/selenium/test_selenium_builder.py @@ -5,8 +5,8 @@ import os from bzt import TaurusConfigError -from tests import RESOURCES_DIR -from tests.modules.selenium import SeleniumTestCase +from tests.unit import RESOURCES_DIR +from tests.unit.modules.selenium import SeleniumTestCase class TestSeleniumScriptGeneration(SeleniumTestCase): diff --git a/tests/modules/selenium/test_selenium_executor.py b/tests/unit/modules/selenium/test_selenium_executor.py similarity index 99% rename from tests/modules/selenium/test_selenium_executor.py rename to tests/unit/modules/selenium/test_selenium_executor.py index 720f729b24..544c41426e 100644 --- a/tests/modules/selenium/test_selenium_executor.py +++ b/tests/unit/modules/selenium/test_selenium_executor.py @@ -13,9 +13,9 @@ from bzt.modules.provisioning import Local from bzt.modules.selenium import SeleniumExecutor from bzt.utils import LDJSONReader, FileReader -from tests import BZTestCase, RESOURCES_DIR, ROOT_LOGGER -from tests.mocks import EngineEmul, DummyListener -from tests.modules.selenium import SeleniumTestCase +from tests.unit import BZTestCase, RESOURCES_DIR, ROOT_LOGGER, EngineEmul +from tests.unit.mocks import DummyListener +from tests.unit.modules.selenium import SeleniumTestCase class LDJSONReaderEmul(object): diff --git a/tests/modules/test_ApacheBenchmark.py b/tests/unit/modules/test_ApacheBenchmark.py similarity index 98% rename from tests/modules/test_ApacheBenchmark.py rename to tests/unit/modules/test_ApacheBenchmark.py index db9fa349b1..5ded66ea85 100644 --- a/tests/modules/test_ApacheBenchmark.py +++ b/tests/unit/modules/test_ApacheBenchmark.py @@ -2,7 +2,7 @@ import os from bzt.modules.ab import ApacheBenchmarkExecutor, TSVDataReader -from tests import BZTestCase, ExecutorTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER +from tests.unit import BZTestCase, ExecutorTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER from bzt.utils import EXE_SUFFIX from bzt import ToolError, TaurusConfigError diff --git a/tests/modules/test_FinalStatusReporter.py b/tests/unit/modules/test_FinalStatusReporter.py similarity index 99% rename from tests/modules/test_FinalStatusReporter.py rename to tests/unit/modules/test_FinalStatusReporter.py index 9dac30581e..81516a8a83 100644 --- a/tests/modules/test_FinalStatusReporter.py +++ b/tests/unit/modules/test_FinalStatusReporter.py @@ -8,8 +8,7 @@ from bzt.modules.functional import ResultsTree, FunctionalSample from bzt.modules.reporting import FinalStatus from bzt.utils import BetterDict -from tests import BZTestCase, random_datapoint -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, random_datapoint, EngineEmul class TestFinalStatusReporter(BZTestCase): diff --git a/tests/modules/test_GUIScreen.py b/tests/unit/modules/test_GUIScreen.py similarity index 98% rename from tests/modules/test_GUIScreen.py rename to tests/unit/modules/test_GUIScreen.py index 67454b8467..6fb2e9022e 100644 --- a/tests/modules/test_GUIScreen.py +++ b/tests/unit/modules/test_GUIScreen.py @@ -5,7 +5,7 @@ from bzt import ManualShutdown from bzt.modules.console import TaurusConsole from bzt.utils import is_linux -from tests import BZTestCase +from tests.unit import BZTestCase from bzt.modules.screen import GUIScreen as Screen diff --git a/tests/modules/test_Gatling.py b/tests/unit/modules/test_Gatling.py similarity index 99% rename from tests/modules/test_Gatling.py rename to tests/unit/modules/test_Gatling.py index 3e518e77a0..2b08e70057 100644 --- a/tests/modules/test_Gatling.py +++ b/tests/unit/modules/test_Gatling.py @@ -9,7 +9,7 @@ from bzt.modules.gatling import GatlingExecutor, DataLogReader, is_gatling2 from bzt.modules.provisioning import Local from bzt.utils import EXE_SUFFIX, get_full_path, is_windows -from tests import ExecutorTestCase, BZTestCase, get_cwd, RESOURCES_DIR, BUILD_DIR, close_reader_file, ROOT_LOGGER +from tests.unit import ExecutorTestCase, BZTestCase, RESOURCES_DIR, BUILD_DIR, close_reader_file, ROOT_LOGGER class TestGatlingExecutor(ExecutorTestCase): @@ -452,7 +452,6 @@ def test_script_jar(self): def test_files_find_file(self): curdir = get_full_path(os.curdir) try: - os.chdir(get_cwd() + "/../") self.obj.engine.file_search_paths.append(RESOURCES_DIR + "gatling/") self.obj.engine.config.merge({ "execution": { diff --git a/tests/modules/test_Grinder.py b/tests/unit/modules/test_Grinder.py similarity index 98% rename from tests/modules/test_Grinder.py rename to tests/unit/modules/test_Grinder.py index b2f1d7c639..eb8865f7ef 100644 --- a/tests/modules/test_Grinder.py +++ b/tests/unit/modules/test_Grinder.py @@ -4,7 +4,7 @@ import os from bzt import ToolError -from tests import BZTestCase, RESOURCES_DIR, BUILD_DIR, close_reader_file, ROOT_LOGGER, ExecutorTestCase +from tests.unit import BZTestCase, RESOURCES_DIR, BUILD_DIR, close_reader_file, ROOT_LOGGER, ExecutorTestCase from bzt.modules.aggregator import DataPoint, KPISet from bzt.modules.grinder import GrinderExecutor, DataLogReader, Grinder, GrinderMirrorsManager diff --git a/tests/modules/test_JUnitXMLReporter.py b/tests/unit/modules/test_JUnitXMLReporter.py similarity index 99% rename from tests/modules/test_JUnitXMLReporter.py rename to tests/unit/modules/test_JUnitXMLReporter.py index ca67936b6c..2132a2c229 100644 --- a/tests/modules/test_JUnitXMLReporter.py +++ b/tests/unit/modules/test_JUnitXMLReporter.py @@ -9,8 +9,7 @@ from bzt.modules.passfail import PassFailStatus, DataCriterion, CriteriaProcessor from bzt.modules.reporting import JUnitXMLReporter from bzt.utils import etree, BetterDict -from tests import BZTestCase, RESOURCES_DIR, ROOT_LOGGER -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, RESOURCES_DIR, ROOT_LOGGER, EngineEmul class TestJUnitXML(BZTestCase): diff --git a/tests/modules/test_LocalProvisioning.py b/tests/unit/modules/test_LocalProvisioning.py similarity index 98% rename from tests/modules/test_LocalProvisioning.py rename to tests/unit/modules/test_LocalProvisioning.py index 108c3f1be3..db9ab6cffc 100644 --- a/tests/modules/test_LocalProvisioning.py +++ b/tests/unit/modules/test_LocalProvisioning.py @@ -5,8 +5,7 @@ from bzt import ToolError from bzt.engine import EXEC from bzt.modules.provisioning import Local -from tests import BZTestCase -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, EngineEmul class ScenarioExecutorEmul(object): diff --git a/tests/modules/test_Siege.py b/tests/unit/modules/test_Siege.py similarity index 97% rename from tests/modules/test_Siege.py rename to tests/unit/modules/test_Siege.py index b3f6119846..238ac14a5f 100644 --- a/tests/modules/test_Siege.py +++ b/tests/unit/modules/test_Siege.py @@ -6,7 +6,7 @@ from bzt.modules.siege import SiegeExecutor, DataLogReader from bzt.modules.aggregator import ConsolidatingAggregator -from tests import BZTestCase, ExecutorTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER +from tests.unit import BZTestCase, ExecutorTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER TOOL_NAME = 'siege' + EXE_SUFFIX TOOL_PATH = join(RESOURCES_DIR, "siege", TOOL_NAME) diff --git a/tests/modules/test_SoapUI.py b/tests/unit/modules/test_SoapUI.py similarity index 99% rename from tests/modules/test_SoapUI.py rename to tests/unit/modules/test_SoapUI.py index d05b95da9a..7ca84a67e1 100644 --- a/tests/modules/test_SoapUI.py +++ b/tests/unit/modules/test_SoapUI.py @@ -1,5 +1,5 @@ from bzt.utils import SoapUIScriptConverter -from tests import BZTestCase, RESOURCES_DIR, ROOT_LOGGER +from tests.unit import BZTestCase, RESOURCES_DIR, ROOT_LOGGER class TestSoapUIConverter(BZTestCase): diff --git a/tests/modules/test_Tsung.py b/tests/unit/modules/test_Tsung.py similarity index 99% rename from tests/modules/test_Tsung.py rename to tests/unit/modules/test_Tsung.py index 46411ca14c..485cdbd47c 100644 --- a/tests/modules/test_Tsung.py +++ b/tests/unit/modules/test_Tsung.py @@ -5,7 +5,7 @@ from bzt import TaurusConfigError, ToolError from bzt.modules.tsung import TsungExecutor, TsungStatsReader, TsungConfig, Tsung from bzt.utils import etree, EXE_SUFFIX, BetterDict, is_windows -from tests import BZTestCase, ExecutorTestCase, RESOURCES_DIR, ROOT_LOGGER +from tests.unit import BZTestCase, ExecutorTestCase, RESOURCES_DIR, ROOT_LOGGER TOOL_NAME = 'tsung' + EXE_SUFFIX diff --git a/tests/modules/test_aggregator.py b/tests/unit/modules/test_aggregator.py similarity index 98% rename from tests/modules/test_aggregator.py rename to tests/unit/modules/test_aggregator.py index 8792a89a1d..9162b94cd9 100644 --- a/tests/modules/test_aggregator.py +++ b/tests/unit/modules/test_aggregator.py @@ -2,10 +2,10 @@ import time from bzt.utils import to_json -from tests import BZTestCase, ROOT_LOGGER +from tests.unit import BZTestCase, ROOT_LOGGER from bzt.modules.aggregator import ResultsReader, DataPoint, KPISet -from tests.mocks import r, rc, err, MockReader +from tests.unit.mocks import r, rc, err, MockReader class TestResultsReader(BZTestCase): diff --git a/tests/modules/test_blazeMeterUploader.py b/tests/unit/modules/test_blazeMeterUploader.py similarity index 99% rename from tests/modules/test_blazeMeterUploader.py rename to tests/unit/modules/test_blazeMeterUploader.py index e418974743..91fc9a06fd 100644 --- a/tests/modules/test_blazeMeterUploader.py +++ b/tests/unit/modules/test_blazeMeterUploader.py @@ -14,8 +14,7 @@ from bzt.modules.blazemeter import BlazeMeterUploader from bzt.modules.blazemeter import MonitoringBuffer from bzt.utils import iteritems, viewvalues -from tests import BZTestCase, random_datapoint, RESOURCES_DIR, ROOT_LOGGER -from tests.mocks import EngineEmul, BZMock +from tests.unit import BZTestCase, random_datapoint, RESOURCES_DIR, ROOT_LOGGER, EngineEmul, BZMock class TestBlazeMeterUploader(BZTestCase): diff --git a/tests/modules/test_cloudProvisioning.py b/tests/unit/modules/test_cloudProvisioning.py similarity index 99% rename from tests/modules/test_cloudProvisioning.py rename to tests/unit/modules/test_cloudProvisioning.py index d60df34a0c..4759da034c 100644 --- a/tests/modules/test_cloudProvisioning.py +++ b/tests/unit/modules/test_cloudProvisioning.py @@ -19,8 +19,8 @@ from bzt.modules.selenium import SeleniumExecutor from bzt.modules.apiritif import ApiritifTester from bzt.utils import get_full_path, BetterDict -from tests import BZTestCase, RESOURCES_DIR, BASE_CONFIG, ROOT_LOGGER -from tests.mocks import EngineEmul, ModuleMock, BZMock +from tests.unit import BZTestCase, BZT_DIR, RESOURCES_DIR, BASE_CONFIG, ROOT_LOGGER, EngineEmul +from tests.unit.mocks import ModuleMock, BZMock class TestCloudProvisioning(BZTestCase): @@ -483,7 +483,7 @@ def test_cloud_config_cleanup_selenium(self): 'blazemeter': {'strange_param': False}, 'selenium': {'virtual-display': False}, 'apiritif': {'verbose': False}, - 'private_mod': {'class': 'tests.mocks.ModuleMock', 'send-to-blazemeter': True} + 'private_mod': {'class': 'tests.unit.mocks.ModuleMock', 'send-to-blazemeter': True} }) self.assertEqual(target, cloud_config.get("modules")) @@ -1036,11 +1036,11 @@ def test_cloud_paths(self): for _file in files_in_home[1:]: open(_file['fullname'], 'a').close() - self.obj.engine.file_search_paths = ['tests'] # config not in cwd + self.obj.engine.file_search_paths = ['tests', os.path.join('tests', 'unit')] # config not in cwd # 'files' are treated similar in all executors so check only one self.obj.engine.config[EXEC][0]['files'] = [ - os.path.join(os.getcwd(), 'tests', 'test_CLI.py'), # full path + os.path.join(BZT_DIR, 'tests', 'unit', 'test_CLI.py'), # full path files_in_home[2]['shortname'], # path from ~ os.path.join('resources', 'jmeter', 'jmeter-loader.bat'), # relative path 'mocks.py', # only basename (look at file_search_paths) diff --git a/tests/modules/test_consoleStatusReporter.py b/tests/unit/modules/test_consoleStatusReporter.py similarity index 97% rename from tests/modules/test_consoleStatusReporter.py rename to tests/unit/modules/test_consoleStatusReporter.py index ed59b17b2a..9960d1f527 100644 --- a/tests/modules/test_consoleStatusReporter.py +++ b/tests/unit/modules/test_consoleStatusReporter.py @@ -1,15 +1,15 @@ import sys import time -from tests import BZTestCase, RESOURCES_DIR +from tests.unit import BZTestCase, RESOURCES_DIR, EngineEmul from bzt.engine import Provisioning, ScenarioExecutor from bzt.modules.aggregator import DataPoint, KPISet from bzt.modules.console import ConsoleStatusReporter from bzt.modules.provisioning import Local from bzt.utils import is_windows, EXE_SUFFIX -from tests.mocks import r, rc, EngineEmul -from tests.modules.jmeter import MockJMeterExecutor +from tests.unit.mocks import r, rc +from tests.unit.modules.jmeter import MockJMeterExecutor class TestConsoleStatusReporter(BZTestCase): diff --git a/tests/modules/test_consolidatingAggregator.py b/tests/unit/modules/test_consolidatingAggregator.py similarity index 99% rename from tests/modules/test_consolidatingAggregator.py rename to tests/unit/modules/test_consolidatingAggregator.py index 447e4fe4f3..4afa4954bc 100644 --- a/tests/modules/test_consolidatingAggregator.py +++ b/tests/unit/modules/test_consolidatingAggregator.py @@ -3,8 +3,8 @@ from apiritif import random_string from bzt.modules.aggregator import ConsolidatingAggregator, DataPoint, KPISet, AggregatorListener from bzt.utils import to_json -from tests import BZTestCase -from tests.mocks import r, MockReader, EngineEmul +from tests.unit import BZTestCase, EngineEmul +from tests.unit.mocks import r, MockReader def get_success_reader(offset=0): diff --git a/tests/modules/test_external.py b/tests/unit/modules/test_external.py similarity index 98% rename from tests/modules/test_external.py rename to tests/unit/modules/test_external.py index 8ab376529b..d6503020b1 100644 --- a/tests/modules/test_external.py +++ b/tests/unit/modules/test_external.py @@ -6,8 +6,8 @@ from bzt.modules.gatling import DataLogReader as GatlingLogReader from bzt.modules.grinder import DataLogReader as GrinderLogReader -from tests import RESOURCES_DIR, close_reader_file, ExecutorTestCase -from tests.mocks import MockReader +from tests.unit import RESOURCES_DIR, close_reader_file, ExecutorTestCase +from tests.unit.mocks import MockReader class TestExternalResultsLoader(ExecutorTestCase): diff --git a/tests/modules/test_functionalAggregator.py b/tests/unit/modules/test_functionalAggregator.py similarity index 96% rename from tests/modules/test_functionalAggregator.py rename to tests/unit/modules/test_functionalAggregator.py index 05f1e2d3c4..2187dd8f1a 100644 --- a/tests/modules/test_functionalAggregator.py +++ b/tests/unit/modules/test_functionalAggregator.py @@ -1,7 +1,7 @@ -from tests import BZTestCase +from tests.unit import BZTestCase from bzt.modules.functional import FunctionalAggregator, FunctionalSample -from tests.mocks import MockFunctionalReader, MockFunctionalListener +from tests.unit.mocks import MockFunctionalReader, MockFunctionalListener class TestFunctionalAggregator(BZTestCase): diff --git a/tests/modules/test_locustIOExecutor.py b/tests/unit/modules/test_locustIOExecutor.py similarity index 99% rename from tests/modules/test_locustIOExecutor.py rename to tests/unit/modules/test_locustIOExecutor.py index ea257c31eb..c344158046 100644 --- a/tests/modules/test_locustIOExecutor.py +++ b/tests/unit/modules/test_locustIOExecutor.py @@ -12,7 +12,7 @@ from bzt.modules.provisioning import Local -from tests import ExecutorTestCase, RESOURCES_DIR, ROOT_LOGGER +from tests.unit import ExecutorTestCase, RESOURCES_DIR, ROOT_LOGGER class TestLocustIOExecutor(ExecutorTestCase): diff --git a/tests/modules/test_molotov.py b/tests/unit/modules/test_molotov.py similarity index 97% rename from tests/modules/test_molotov.py rename to tests/unit/modules/test_molotov.py index 72300486a1..ab049757be 100644 --- a/tests/modules/test_molotov.py +++ b/tests/unit/modules/test_molotov.py @@ -7,7 +7,7 @@ from bzt.modules.aggregator import DataPoint, KPISet from bzt.modules.molotov import MolotovExecutor, MolotovReportReader from bzt.utils import EXE_SUFFIX, is_windows -from tests import BZTestCase, ExecutorTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER +from tests.unit import BZTestCase, ExecutorTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER TOOL_NAME = 'molotov-mock' + EXE_SUFFIX TOOL_PATH = join(RESOURCES_DIR, "molotov", TOOL_NAME) diff --git a/tests/modules/test_monitoring.py b/tests/unit/modules/test_monitoring.py similarity index 98% rename from tests/modules/test_monitoring.py rename to tests/unit/modules/test_monitoring.py index 385a8145cb..85f1b24dec 100644 --- a/tests/modules/test_monitoring.py +++ b/tests/unit/modules/test_monitoring.py @@ -5,8 +5,8 @@ from bzt.modules.monitoring import Monitoring, MonitoringListener, MonitoringCriteria from bzt.modules.monitoring import ServerAgentClient, GraphiteClient, LocalClient, LocalMonitor from bzt.utils import b, BetterDict -from tests import BZTestCase, ROOT_LOGGER -from tests.mocks import EngineEmul, SocketEmul +from tests.unit import BZTestCase, ROOT_LOGGER, EngineEmul +from tests.unit.mocks import SocketEmul class TestMonitoring(BZTestCase): diff --git a/tests/modules/test_passFailStatus.py b/tests/unit/modules/test_passFailStatus.py similarity index 98% rename from tests/modules/test_passFailStatus.py rename to tests/unit/modules/test_passFailStatus.py index 825e8db8ab..8e93f03acd 100644 --- a/tests/modules/test_passFailStatus.py +++ b/tests/unit/modules/test_passFailStatus.py @@ -4,8 +4,8 @@ from bzt import AutomatedShutdown, TaurusConfigError from bzt.modules.aggregator import DataPoint, KPISet from bzt.modules.passfail import PassFailStatus, DataCriterion, CriteriaProcessor -from tests import BZTestCase, random_datapoint, RESOURCES_DIR, ROOT_LOGGER -from tests.mocks import EngineEmul, ModuleMock +from tests.unit import BZTestCase, random_datapoint, RESOURCES_DIR, ROOT_LOGGER, EngineEmul +from tests.unit.mocks import ModuleMock class PassFailStatusMock(PassFailStatus): diff --git a/tests/modules/test_pbench.py b/tests/unit/modules/test_pbench.py similarity index 99% rename from tests/modules/test_pbench.py rename to tests/unit/modules/test_pbench.py index d3e7313475..e1354f0ad2 100644 --- a/tests/modules/test_pbench.py +++ b/tests/unit/modules/test_pbench.py @@ -14,8 +14,8 @@ from bzt.modules.aggregator import ConsolidatingAggregator, DataPoint, KPISet, AggregatorListener from bzt.modules.pbench import PBenchExecutor, Scheduler, TaurusPBenchGenerator from bzt.utils import b, is_windows -from tests import RESOURCES_DIR, close_reader_file, ROOT_LOGGER -from tests.cases import ExecutorTestCase +from tests.unit import RESOURCES_DIR, close_reader_file, ROOT_LOGGER +from tests.unit.cases import ExecutorTestCase class DataPointLogger(AggregatorListener): diff --git a/tests/modules/test_proxy2jmx.py b/tests/unit/modules/test_proxy2jmx.py similarity index 93% rename from tests/modules/test_proxy2jmx.py rename to tests/unit/modules/test_proxy2jmx.py index c764e21ddc..fb9a2be227 100644 --- a/tests/modules/test_proxy2jmx.py +++ b/tests/unit/modules/test_proxy2jmx.py @@ -6,9 +6,8 @@ from bzt import TaurusConfigError from bzt.modules.proxy2jmx import Proxy2JMX, BZAProxy from bzt.modules.selenium import SeleniumExecutor -from bzt.utils import is_windows, is_linux, get_full_path -from tests import BZTestCase -from tests.mocks import EngineEmul +from bzt.utils import is_windows, is_linux, get_full_path, RESOURCES_DIR +from tests.unit import BZTestCase, EngineEmul class BZAProxyEmul(BZAProxy): @@ -46,14 +45,12 @@ def setUp(self): super(TestProxy2JMX, self).setUp() self.obj = Proxy2JMXEmul() self.obj.engine = EngineEmul() - res_dir = join(get_full_path(__file__, step_up=3), 'bzt', 'resources') - src = join(res_dir, 'chrome-loader.c') - dst_loader = join(res_dir, 'chrome-loader.exe') + src = join(RESOURCES_DIR, 'chrome-loader.c') + dst_loader = join(RESOURCES_DIR, 'chrome-loader.exe') shutil.copy2(src, dst_loader) def tearDown(self): - res_dir = join(get_full_path(__file__, step_up=3), 'bzt', 'resources') - dst_loader = join(res_dir, 'chrome-loader.exe') + dst_loader = join(RESOURCES_DIR, 'chrome-loader.exe') os.remove(dst_loader) super(TestProxy2JMX, self).tearDown() @@ -163,8 +160,7 @@ def _check_windows(self): os.mkdir(join(art_dir, 'Chromium')) os.mkdir(join(art_dir, 'Chromium', 'Application')) os.mkdir(join(art_dir, 'chromedriver')) - res_dir = join(get_full_path(__file__, step_up=3), 'bzt', 'resources') - src = join(res_dir, 'chrome-loader.c') + src = join(RESOURCES_DIR, 'chrome-loader.c') dst_chrome = join(art_dir, 'Chromium', 'Application', 'chrome.exe') dst_chromedriver = join(art_dir, 'chromedriver', 'chromedriver.exe') diff --git a/tests/modules/test_services.py b/tests/unit/modules/test_services.py similarity index 98% rename from tests/modules/test_services.py rename to tests/unit/modules/test_services.py index c3281abce5..565a85cce4 100644 --- a/tests/modules/test_services.py +++ b/tests/unit/modules/test_services.py @@ -9,8 +9,8 @@ from bzt.modules.blazemeter import CloudProvisioning from bzt.modules.services import Unpacker, InstallChecker, AndroidEmulatorLoader, AppiumLoader, PipInstaller from bzt.utils import get_files_recursive, EXE_SUFFIX, JavaVM, Node -from tests import BZTestCase, get_cwd, RESOURCES_DIR -from tests.mocks import EngineEmul, ModuleMock, BZMock +from tests.unit import BZTestCase, RESOURCES_DIR, EngineEmul +from tests.unit.mocks import ModuleMock, BZMock class TestPipInstaller(BZTestCase): @@ -94,7 +94,7 @@ def test_receive_and_unpack_on_worker(self): obj.parameters["files"] = ["java_package.zip"] # create archive and put it in artifact dir - source = get_cwd() + "/../selenium/junit/java_package" + source = RESOURCES_DIR + "selenium/junit/java_package" zip_name = obj.engine.create_artifact('java_package', '.zip') with zipfile.ZipFile(zip_name, 'w') as zip_file: for filename in get_files_recursive(source): diff --git a/tests/modules/test_shellexec.py b/tests/unit/modules/test_shellexec.py similarity index 99% rename from tests/modules/test_shellexec.py rename to tests/unit/modules/test_shellexec.py index 55955c8bb6..f55eaf6257 100644 --- a/tests/modules/test_shellexec.py +++ b/tests/unit/modules/test_shellexec.py @@ -6,8 +6,7 @@ from bzt.engine import Service from bzt.modules.shellexec import ShellExecutor from bzt.utils import BetterDict, is_windows, temp_file -from tests import BZTestCase -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, EngineEmul class TaskTestCase(BZTestCase): diff --git a/tests/test_CLI.py b/tests/unit/test_CLI.py similarity index 98% rename from tests/test_CLI.py rename to tests/unit/test_CLI.py index 6a7d8ee052..836116eb1e 100644 --- a/tests/test_CLI.py +++ b/tests/unit/test_CLI.py @@ -5,24 +5,24 @@ import shutil from bzt import TaurusException -from tests import BZTestCase, RESOURCES_DIR +from tests.unit import BZTestCase, RESOURCES_DIR, BUILD_DIR from bzt.cli import CLI, ConfigOverrider, get_option_parser from bzt.engine import Configuration import bzt.modules.shellexec -from tests.mocks import EngineEmul, ModuleMock +from tests.unit import EngineEmul +from tests.unit.mocks import ModuleMock class TestCLI(BZTestCase): def setUp(self): super(TestCLI, self).setUp() self.logger = self.log - self.log = os.path.join(os.path.dirname(__file__), "..", "build", "bzt.log") + self.log = os.path.join(BUILD_DIR, "bzt.log") self.verbose = False self.quiet = False self.no_system_configs = True self.option = [] - self.datadir = os.path.join(os.path.dirname(__file__), "..", "build", "acli") self.obj = CLI(self) self.assertTrue(os.path.exists(self.log)) diff --git a/tests/test_bza.py b/tests/unit/test_bza.py similarity index 91% rename from tests/test_bza.py rename to tests/unit/test_bza.py index 00ba9e3911..9f553d32c6 100644 --- a/tests/test_bza.py +++ b/tests/unit/test_bza.py @@ -2,8 +2,8 @@ from bzt import TaurusNetworkError from bzt.bza import User, BZAObject -from tests import BZTestCase -from tests.mocks import BZMock +from tests.unit import BZTestCase +from tests.unit.mocks import BZMock class TestBZAClient(BZTestCase): diff --git a/tests/test_configuration.py b/tests/unit/test_configuration.py similarity index 98% rename from tests/test_configuration.py rename to tests/unit/test_configuration.py index 8c31b6fda2..a5c1bc4f7c 100644 --- a/tests/test_configuration.py +++ b/tests/unit/test_configuration.py @@ -3,8 +3,7 @@ from bzt.engine import Configuration from bzt.utils import BetterDict, dehumanize_time, temp_file -from tests import BZTestCase, RESOURCES_DIR, BASE_CONFIG, ROOT_LOGGER -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, RESOURCES_DIR, BASE_CONFIG, ROOT_LOGGER, EngineEmul class TestConfiguration(BZTestCase): diff --git a/tests/test_engine.py b/tests/unit/test_engine.py similarity index 98% rename from tests/test_engine.py rename to tests/unit/test_engine.py index ae6d6d0394..730044388d 100644 --- a/tests/test_engine.py +++ b/tests/unit/test_engine.py @@ -7,8 +7,7 @@ from bzt import TaurusConfigError from bzt.engine import Configuration, EXEC from bzt.utils import BetterDict, is_windows, get_full_path, get_uniq_name, communicate -from tests import local_paths_config, RESOURCES_DIR, BZTestCase, ExecutorTestCase, TEST_DIR -from tests.mocks import EngineEmul +from tests.unit import local_paths_config, RESOURCES_DIR, BZTestCase, ExecutorTestCase, TEST_DIR, EngineEmul class TestEngine(BZTestCase): @@ -111,7 +110,7 @@ def test_null_aggregator(self): }, "modules": { "local": "bzt.modules.provisioning.Local", - "jmeter": {"class": "tests.modules.jmeter.MockJMeterExecutor", + "jmeter": {"class": "tests.unit.modules.jmeter.MockJMeterExecutor", "detect-plugins": False, "protocol-handlers": {"http": "bzt.jmx.http.HTTPProtocolHandler"}}, }}) diff --git a/tests/test_jmx2yaml.py b/tests/unit/test_jmx2yaml.py similarity index 99% rename from tests/test_jmx2yaml.py rename to tests/unit/test_jmx2yaml.py index 2a1967142d..1a2402685e 100644 --- a/tests/test_jmx2yaml.py +++ b/tests/unit/test_jmx2yaml.py @@ -7,7 +7,7 @@ from bzt.jmx2yaml import JMX2YAML from bzt.utils import get_full_path, FileReader, temp_file -from tests import BZTestCase, RESOURCES_DIR +from tests.unit import BZTestCase, RESOURCES_DIR class FakeOptions(object): diff --git a/tests/test_linter.py b/tests/unit/test_linter.py similarity index 98% rename from tests/test_linter.py rename to tests/unit/test_linter.py index b65f53a11e..700e9d08e5 100644 --- a/tests/test_linter.py +++ b/tests/unit/test_linter.py @@ -2,7 +2,7 @@ from bzt.linter import ConfigurationLinter, ConfigWarning from bzt.utils import BetterDict -from tests import BZTestCase +from tests.unit import BZTestCase class TestLinter(BZTestCase): diff --git a/tests/test_multiPartForm.py b/tests/unit/test_multiPartForm.py similarity index 93% rename from tests/test_multiPartForm.py rename to tests/unit/test_multiPartForm.py index e4b67bc10b..0079c9ab4f 100644 --- a/tests/test_multiPartForm.py +++ b/tests/unit/test_multiPartForm.py @@ -2,7 +2,7 @@ import os from bzt.utils import MultiPartForm -from tests import BZTestCase, RESOURCES_DIR +from tests.unit import BZTestCase, RESOURCES_DIR class TestMultiPartForm(BZTestCase): diff --git a/tests/test_soapui2yaml.py b/tests/unit/test_soapui2yaml.py similarity index 87% rename from tests/test_soapui2yaml.py rename to tests/unit/test_soapui2yaml.py index bf39de6f71..98b5d0cfbe 100644 --- a/tests/test_soapui2yaml.py +++ b/tests/unit/test_soapui2yaml.py @@ -1,9 +1,8 @@ import yaml -from bzt.soapui2yaml import SoapUI2YAML, process +from bzt.soapui2yaml import process -from tests import BZTestCase, get_cwd, RESOURCES_DIR -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, RESOURCES_DIR, EngineEmul class FakeOptions(object): @@ -21,9 +20,6 @@ def setUp(self): super(TestConverter, self).setUp() self.engine = EngineEmul() - def _get_soapui2yaml(self, path, file_name=None, test_case=None): - return SoapUI2YAML(FakeOptions(file_name=file_name, test_case=test_case), get_cwd() + path) - def _get_tmp(self, prefix='test', suffix='.yml'): return self.engine.create_artifact(prefix, suffix) diff --git a/tests/test_swagger2yaml.py b/tests/unit/test_swagger2yaml.py similarity index 99% rename from tests/test_swagger2yaml.py rename to tests/unit/test_swagger2yaml.py index ae5ecd62fb..5d55f7e5e7 100644 --- a/tests/test_swagger2yaml.py +++ b/tests/unit/test_swagger2yaml.py @@ -2,8 +2,7 @@ from bzt.utils import iteritems from bzt.swagger2yaml import SwaggerConverter, Swagger, Swagger2YAML, process -from tests import BZTestCase, RESOURCES_DIR, ROOT_LOGGER -from tests.mocks import EngineEmul +from tests.unit import BZTestCase, RESOURCES_DIR, ROOT_LOGGER, EngineEmul class FakeOptions(object): diff --git a/tests/test_utils.py b/tests/unit/test_utils.py similarity index 99% rename from tests/test_utils.py rename to tests/unit/test_utils.py index 75d1fa6077..c02da25f77 100644 --- a/tests/test_utils.py +++ b/tests/unit/test_utils.py @@ -10,8 +10,8 @@ from bzt import TaurusNetworkError from bzt.utils import log_std_streams, get_uniq_name, JavaVM, ToolError, is_windows, HTTPClient, BetterDict from bzt.utils import ensure_is_dict, Environment, temp_file, communicate -from tests import BZTestCase, RESOURCES_DIR -from tests.mocks import MockFileReader +from tests.unit import BZTestCase, RESOURCES_DIR +from tests.unit.mocks import MockFileReader class MockPopen(object):