diff --git a/tests/test_complete_doc.py b/tests/test_complete_doc.py deleted file mode 100644 index 4630128..0000000 --- a/tests/test_complete_doc.py +++ /dev/null @@ -1,24 +0,0 @@ -from postman_cli_transformer.cli import parse -import json - - -def test_finished_product(): - # This seems like a lot of conversions to make, but it works - expected_result = open("tests/test_data/expected-results.txt") - expected_data = expected_result.read() - expected_json = json.loads(expected_data) - expected_json_str = json.dumps(expected_json, sort_keys=True) - - raw_output_from_postman_cli = open("tests/test_data/postman-cli-run.txt") - raw_data = raw_output_from_postman_cli.read() - parsed_data = parse(raw_data) - parsed_json = json.loads(parsed_data) - parsed_json_str = json.dumps(parsed_json, sort_keys=True) - - print(parsed_json_str) - print("\n\n\n") - print(expected_json_str) - - # TODO: get a complete file run once all the parsing is done - - # assert parsed_json_str == expected_json_str diff --git a/tests/test_data/expected-results.txt b/tests/test_data/expected-results.txt deleted file mode 100644 index 2479a85..0000000 --- a/tests/test_data/expected-results.txt +++ /dev/null @@ -1,168 +0,0 @@ -{ - "collectionName": "Craig Private Pinball Map Collection", - "folders": [ - { - "name": "Regions", - "requests": [ - { - "httpVerb": "GET", - "name": "Get location and machine counts", - "response": { - "code": "200 OK", - "size": "1.34kB", - "time": "274ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response has the required fields - num_locations and num_lmxes", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions/location_and_machine_counts.json" - }, - { - "httpVerb": "GET", - "name": "Fetch all regions", - "response": { - "code": "200 OK", - "size": "29.2kB", - "time": "114ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Validate the response schema for the presence of all required fields", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions.json" - }, - { - "httpVerb": "GET", - "name": "Find if name corresponds to a known region", - "response": { - "code": "200 OK", - "size": "1.84kB", - "time": "78ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is within an acceptable range", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Region object structure is as expected", - "status": { - "details": "1", - "result": "FAILED" - } - }, - { - "desc": "All required fields in the 'region' object are present and not empty", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Region object has correct data types for fields", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions/does_region_exist.json?name=minnesota" - } - ] - }, - { - "name": "Machines", - "requests": [ - { - "httpVerb": "GET", - "name": "Fetch all machines", - "response": { - "code": "200 OK", - "size": "65.14kB", - "time": "151ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response has the required fields", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response content type is application/json", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/machines.json?region_id=119&manufacturer=Stern" - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/test_data/new_results.txt b/tests/test_data/new_results.txt deleted file mode 100644 index d65955e..0000000 --- a/tests/test_data/new_results.txt +++ /dev/null @@ -1,339 +0,0 @@ -{ - "collectionName": "Craig Private Pinball Map Collection", - "folders": [ - { - "name": "Regions", - "requests": [ - { - "httpVerb": "GET", - "name": "Get location and machine counts", - "response": { - "code": "200 OK", - "size": "1.34kB", - "time": "274ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response has the required fields - num_locations and num_lmxes", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions/location_and_machine_counts.json" - }, - { - "httpVerb": "GET", - "name": "Fetch all regions", - "response": { - "code": "200 OK", - "size": "29.2kB", - "time": "114ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Validate the response schema for the presence of all required fields", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions.json" - }, - { - "httpVerb": "GET", - "name": "Find if name corresponds to a known region", - "response": { - "code": "200 OK", - "size": "1.84kB", - "time": "78ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is within an acceptable range", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Region object structure is as expected", - "status": { - "details": "1", - "result": "FAILED" - } - }, - { - "desc": "All required fields in the 'region' object are present and not empty", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Region object has correct data types for fields", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions/does_region_exist.json?name=minnesota" - } - ] - }, - { - "name": "Machines", - "requests": [ - { - "httpVerb": "GET", - "name": "Fetch all machines", - "response": { - "code": "200 OK", - "size": "65.14kB", - "time": "151ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response has the required fields", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response content type is application/json", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/machines.json?region_id=119&manufacturer=Stern" - } - ] - }, - { - "name": "Repeats / Regions Copy", - "requests": [ - { - "httpVerb": "GET", - "name": "Get location and machine counts", - "response": { - "code": "200 OK", - "size": "1.33kB", - "time": "100ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response has the required fields - num_locations and num_lmxes", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions/location_and_machine_counts.json" - }, - { - "httpVerb": "GET", - "name": "Fetch all regions", - "response": { - "code": "200 OK", - "size": "29.2kB", - "time": "120ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Validate the response schema for the presence of all required fields", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions.json" - }, - { - "httpVerb": "GET", - "name": "Find if name corresponds to a known region", - "response": { - "code": "200 OK", - "size": "1.83kB", - "time": "85ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is within an acceptable range", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Region object structure is as expected", - "status": { - "details": "2", - "result": "FAILED" - } - }, - { - "desc": "All required fields in the 'region' object are present and not empty", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Region object has correct data types for fields", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/regions/does_region_exist.json?name=minnesota" - } - ] - }, - { - "name": "Repeats / Machines Copy", - "requests": [ - { - "httpVerb": "GET", - "name": "Fetch all machines", - "response": { - "code": "200 OK", - "size": "1.33kB", - "time": "122ms" - }, - "tests": [ - { - "desc": "Response status code is 200", - "status": { - "details": "", - "result": "SUCCESS" - } - }, - { - "desc": "Response time is less than 500ms", - "status": { - "details": "", - "result": "SUCCESS" - } - } - ], - "url": "https://pinballmap.com//api/v1/machines.json?region_id=119&manufacturer=stern" - }, - { - "httpVerb": "GET", - "name": "", - "response": { - "code": "401 Unauthorized", - "size": "485B", - "time": "224ms" - }, - "tests": [], - "url": "https://api.getpostman.com/scim/v2/Users?count=10000" - }, - { - "httpVerb": "PATCH", - "name": "", - "response": { - "code": "401 Unauthorized", - "size": "485B", - "time": "58ms" - }, - "tests": [], - "url": "https://api.getpostman.com/scim/v2/Users/{{userId}}" - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/test_data/postman-cli-run.txt b/tests/test_data/postman-cli-run.txt index 4817c2c..607a2f4 100644 --- a/tests/test_data/postman-cli-run.txt +++ b/tests/test_data/postman-cli-run.txt @@ -104,4 +104,4 @@ Craig Private Pinball Map Collection inside "Repeats / Regions Copy / Find if name corresponds to a known region" Postman CLI run data uploaded to Postman Cloud successfully. -You can view the run data in Postman at: https://go.postman.co/workspace/71a6b37b-a01d-43b4-bcf2-4cc75f1d3d7b/run/33123329-8f0fd124-0f81-4513-bc7b-2addad984241 +You can view the run data in Postman at: https://go.postman.co/workspace/71a6b37b-a01d-43b4-bcf2-4cc75f1d3d7b/run/33123329-8f0fd124-0f81-4513-bc7b-2addad984241 \ No newline at end of file