From bf5deb30e0daf494f4da36d13cca89f9ba332b9c Mon Sep 17 00:00:00 2001 From: GabrielBarberini Date: Tue, 26 Sep 2023 00:58:34 -0300 Subject: [PATCH 1/2] adds default parameters for motor, rocket and flight classes --- lib/models/aerosurfaces.py | 36 +- lib/models/environment.py | 4 +- lib/models/flight.py | 10 +- lib/models/motor.py | 30 +- lib/models/parachute.py | 10 +- lib/models/rocket.py | 20 +- test/Infinity-API.postman_collection.json | 2472 +++++++++++++++++++++ 7 files changed, 2527 insertions(+), 55 deletions(-) create mode 100644 test/Infinity-API.postman_collection.json diff --git a/lib/models/aerosurfaces.py b/lib/models/aerosurfaces.py index 0723796..490c99f 100644 --- a/lib/models/aerosurfaces.py +++ b/lib/models/aerosurfaces.py @@ -7,29 +7,29 @@ class RailButtons(BaseModel, frozen=True): angular_position: Optional[float] = 45 class NoseCone(BaseModel, frozen=True): - length: float - kind: str - position: float - base_radius: float - rocket_radius: float + length: float = 0.55829 + kind: str = "vonKarman" + position: float = 1.278 + base_radius: float = 0.0635 + rocket_radius: float = 0.0635 class Fins(BaseModel, frozen=True): - n: int - root_chord: float - tip_chord: float - span: float - position: float - cant_angle: float - radius: float - airfoil: str + n: int = 4 + root_chord: float = 0.12 + tip_chord: float = 0.04 + span: float = 0.1 + position: float = -1.04956 + cant_angle: float = 0 + radius: float = 0.0635 + airfoil: str = "" class TrapezoidalFins(Fins, frozen=True): def __init__(self): super().__init__() class Tail(BaseModel, frozen=True): - top_radius: float - bottom_radius: float - length: float - position: float - radius: float + top_radius: float = 0.0635 + bottom_radius: float = 0.0435 + length: float = 0.06 + position: float = -1.194656 + radius: float = 0.0635 diff --git a/lib/models/environment.py b/lib/models/environment.py index ddc9eee..8374cf7 100644 --- a/lib/models/environment.py +++ b/lib/models/environment.py @@ -3,8 +3,8 @@ from pydantic import BaseModel class Env(BaseModel, frozen=True): - latitude: float - longitude: float + latitude: float = 0 + longitude: float = 0 rail_length: Optional[float] = 5.2 elevation: Optional[int] = 1400 atmospheric_model_type: Optional[str] = 'standard_atmosphere' diff --git a/lib/models/flight.py b/lib/models/flight.py index eb5e19b..20182bd 100644 --- a/lib/models/flight.py +++ b/lib/models/flight.py @@ -3,8 +3,8 @@ from lib.models.environment import Env class Flight(BaseModel, frozen=True): - environment: Env - rocket: Rocket - inclination: int - heading: int - rail_length: float + environment: Env = Env() + rocket: Rocket = Rocket() + inclination: int = 85 + heading: int = 0 + rail_length: float = 5.2 diff --git a/lib/models/motor.py b/lib/models/motor.py index f642466..84e2217 100644 --- a/lib/models/motor.py +++ b/lib/models/motor.py @@ -7,20 +7,20 @@ class MotorOptions(str, Enum): custom: str = "Custom (Coming soon)" class Motor(BaseModel, frozen=True): - burn_time: float - dry_mass: float + burn_time: float = 3.9 + dry_mass: float = 1.815 dry_inertia: "Tuple[float, float, float]" = (0.125, 0.125, 0.002) - center_of_dry_mass_position: float - grain_number: int - grain_density: float - grain_outer_radius: float - grain_initial_inner_radius: float - grain_initial_height: float - grains_center_of_mass_position: float + center_of_dry_mass_position: float = 0.317 + grain_number: int = 5 + grain_density: float = 1815 + grain_outer_radius: float = 0.033 + grain_initial_inner_radius: float = 0.015 + grain_initial_height: float = 0.12 + grains_center_of_mass_position: float = -0.85704 #TBD: thrust_source must be the id of a previously uploaded .eng file and a list of "default" files must be provided in the api docs - thrust_source: MotorOptions = "Cesarani_M1670" - grain_separation: float - nozzle_radius: float - throat_radius: float - interpolation_method: str - coordinate_system_orientation: str + thrust_source: MotorOptions = "Cesaroni_M1670" + grain_separation: float = 0.005 + nozzle_radius: float = 0.033 + throat_radius: float = 0.011 + interpolation_method: str = "linear" + coordinate_system_orientation: str = "nozzle_to_combustion_chamber" diff --git a/lib/models/parachute.py b/lib/models/parachute.py index 6111a68..8b075fa 100644 --- a/lib/models/parachute.py +++ b/lib/models/parachute.py @@ -2,12 +2,12 @@ from pydantic import BaseModel class Parachute(BaseModel, frozen=True): - name: "List[str]" - cd_s: "List[float]" - sampling_rate: "List[int]" - lag: "List[float]" + name: "List[str]" = ["Main","Drogue"] + cd_s: "List[float]" = [10, 1] + sampling_rate: "List[int]" = [105, 105] + lag: "List[float]" = [1.5, 1.5] noise: "List[Tuple[float, float, float]]" = [(0, 8.3, 0.5), (0, 8.3, 0.5)] - triggers: "List[str]" + triggers: "List[str]" = ["lambda p, h, y: y[5] < 0 and h < 800", "lambda p, h, y: y[5] < 0"] def __hash__(self): return hash(( diff --git a/lib/models/rocket.py b/lib/models/rocket.py index a646d07..632b5bf 100644 --- a/lib/models/rocket.py +++ b/lib/models/rocket.py @@ -10,19 +10,19 @@ class RocketOptions(str, Enum): custom: str = "Custom (Coming soon)" class Rocket(BaseModel, frozen=True): - radius: float - mass: float + radius: float = 0.0632 + mass: float = 16.235 inertia: "Tuple[float, float, float]" = (6.321, 6.321, 0.0346) #TBD: powerOffDrag an powerOnDrag need to be the id of previously uploaded .csv files and a list of "default" files must be provided in the api docs power_off_drag: RocketOptions = "calisto" power_on_drag: RocketOptions = "calisto" - center_of_mass_without_motor: int + center_of_mass_without_motor: int = 0 #TBD: a list of possible tailToNose values must be provided in the api docs coordinate_system_orientation: Optional[str] = "tail_to_nose" - motor_position: float - rail_buttons: RailButtons - motor: Motor - nose: NoseCone - fins: Fins - tail: Tail - parachutes: Parachute + motor_position: float = -1.255 + rail_buttons: RailButtons = RailButtons() + motor: Motor = Motor() + nose: NoseCone = NoseCone() + fins: Fins = Fins() + tail: Tail = Tail() + parachutes: Parachute = Parachute() diff --git a/test/Infinity-API.postman_collection.json b/test/Infinity-API.postman_collection.json new file mode 100644 index 0000000..203e044 --- /dev/null +++ b/test/Infinity-API.postman_collection.json @@ -0,0 +1,2472 @@ +{ + "info": { + "_postman_id": "00c970b2-c429-4ecd-a1f7-de23aa286d10", + "name": "Infinity-API", + "description": "# About this collection\n\nThe API under this collection includes four artifacts **{Environment, Flight, Motor and Rocket}** with 6 endpoints each covering artifact **creation, reading, editing, deleting, simulating and retrieving artifact as jsonpickle string.**\n\n- POST `api/artifact/{{artifact_id}}` { message, artifact_id }\n \n- GET `api/artifact/{{artifact_id}}` { Artifact }\n \n- GET `api/rocketpy/artifact/{{artifact_id}}` { json_pickle_string_artifact }\n \n- GET `api/simulate/artifact/{{artifact_id}}` { ArtifactSimulationSummary }\n \n- PUT `api/artifact/{{artifact_id}}` { message, new_artifact_id }\n \n- DELETE `api/artifact/{{artifact_id}}` { deleted_artifact_id, message }\n \n\n**Flight artifact** have also additional routes that allows to update its own artifacts.\n\n- POST `api/flight/{{flight_id}}/artifact/` { message, flight_id }\n \n\n## **Disclaimer**\n\nCurrently the API only supports Solid motors and TrapezoidalFins, sorry for that, we are working to expand its capabilities soon.\n\n## **Using this collection**\n\n- Run this collection by clicking on \"Run\".\n \n\n\n\n## Additional resources\n\n[Scripting in Postman](https://learning.postman.com/docs/writing-scripts/intro-to-scripts/)\n\n[Test script examples](https://learning.postman.com/docs/writing-scripts/script-references/test-examples/)\n\n[Postman Sandbox API reference](https://learning.postman.com/docs/sending-requests/grpc/postman-sandbox-api/#writing-assertions)\n\n[Using the Collection Runner](https://learning.postman.com/docs/collections/running-collections/intro-to-collection-runs/)", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "29631298", + "_collection_link": "https://rocketpy-team.postman.co/workspace/Team-Workspace~d228e0d7-1148-4935-8e58-7db52744ee04/collection/29631298-00c970b2-c429-4ecd-a1f7-de23aa286d10?action=share&source=collection_link&creator=29631298" + }, + "item": [ + { + "name": "Environment", + "item": [ + { + "name": "Create Environment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var envRequest = JSON.parse(pm.request.body.raw);", + "", + "// reduce date for future assert", + "envRequest.date = envRequest.date.substring(0, envRequest.date.length - 7);", + "", + "// save environment parameters", + "pm.environment.set('env_id', apiRspn.env_id) ", + "pm.environment.set('latitude', envRequest.latitude)", + "pm.environment.set('longitude', envRequest.longitude)", + "pm.environment.set('elevation', envRequest.elevation) ", + "pm.environment.set('atmospheric_model_type', envRequest.atmospheric_model_type) ", + "pm.environment.set('atmospheric_model_file', envRequest.atmospheric_model_file) ", + "pm.environment.set('date', envRequest.date) ", + "", + "//TEST", + "bdd = \"Given a valid environment POST request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Environment successfully created\");", + " });", + " pm.test(bdd + \" then response must contain a valid env_id\", function () {", + " pm.expect(apiRspn.env_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"latitude\": 0,\n \"longitude\": 0,\n \"elevation\": 1400,\n \"atmospheric_model_type\": \"standard_atmosphere\",\n \"atmospheric_model_file\": \"GFS\",\n \"date\": \"2023-05-09T16:30:50.065992\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/environments/", + "host": [ + "{{endpoint}}" + ], + "path": [ + "environments", + "" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Read Environment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "", + "var returned_date = apiRspn.date;", + "var reduced_returned_date = returned_date.substring(0, returned_date.length - 7);", + "", + "//TEST", + "bdd = \"Given a valid Environment GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid environment\", function () {", + " pm.expect(apiRspn.latitude).to.eql(pm.environment.get('latitude'), \"latitude not matching\");", + " pm.expect(apiRspn.longitude).to.eql(pm.environment.get('longitude'), \"longitude not matching\"); ", + " pm.expect(apiRspn.elevation).to.eql(pm.environment.get('elevation'), \"elevation not matching\");", + " pm.expect(apiRspn.atmospheric_model_type).to.eql(pm.environment.get('atmospheric_model_type'), \"atmospheric_model_type not matching\");", + " pm.expect(apiRspn.atmospheric_model_file).to.eql(pm.environment.get('atmospheric_model_file'), \"atmospheric_model_file not matching\");", + " pm.expect(reduced_returned_date).to.eql(pm.environment.get('date'), \"date not matching\");", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/environments/{{env_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "environments", + "{{env_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Read rocketpy Environment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "", + "//TEST", + "bdd = \"Given a valid rocketpy Environment GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.jsonpickle_rocketpy_env).to.exist; ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/environments/rocketpy/{{env_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "environments", + "rocketpy", + "{{env_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Simulate Environment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "//TEST", + "bdd = \"Given a valid rocketpy Environment simulate GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.env_data).to.exist; ", + " //pm.expect(apiRspn.env_data.grav).to.exist; ", + " pm.expect(apiRspn.env_data.wind_speed).to.exist;", + " pm.expect(apiRspn.env_data.model_type_max_expected_height).to.exist;", + " pm.expect(apiRspn.env_data.wind_speed).to.exist;", + " pm.expect(apiRspn.env_data.wind_direction).to.exist;", + " pm.expect(apiRspn.env_data.wind_heading).to.exist;", + " pm.expect(apiRspn.env_data.surface_pressure).to.exist;", + " pm.expect(apiRspn.env_data.surface_temperature).to.exist;", + " pm.expect(apiRspn.env_data.surface_air_density).to.exist;", + " pm.expect(apiRspn.env_data.surface_speed_of_sound).to.exist;", + " pm.expect(apiRspn.env_data.launch_date).to.exist;", + " pm.expect(apiRspn.env_data.lat).to.eql(pm.environment.get('latitude'), \"latitude not matching\");", + " pm.expect(apiRspn.env_data.lon).to.eql(pm.environment.get('longitude'), \"longitude not matching\"); ", + " pm.expect(apiRspn.env_data.elevation).to.eql(pm.environment.get('elevation'), \"elevation not matching\");", + " pm.expect(apiRspn.env_data.model_type).to.eql(pm.environment.get('atmospheric_model_type'), \"atmospheric_model_type not matching\"); ", + "", + " pm.expect(apiRspn.env_plots).to.exist; ", + " pm.expect(apiRspn.env_plots.grid).to.exist;", + " pm.expect(apiRspn.env_plots.wind_speed).to.exist;", + " pm.expect(apiRspn.env_plots.wind_direction).to.exist;", + " pm.expect(apiRspn.env_plots.speed_of_sound).to.exist;", + " pm.expect(apiRspn.env_plots.density).to.exist;", + " pm.expect(apiRspn.env_plots.wind_vel_x).to.exist;", + " pm.expect(apiRspn.env_plots.wind_vel_y).to.exist;", + " pm.expect(apiRspn.env_plots.pressure).to.exist;", + " pm.expect(apiRspn.env_plots.temperature).to.exist;", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/environments/{{env_id}}/simulate", + "host": [ + "{{endpoint}}" + ], + "path": [ + "environments", + "{{env_id}}", + "simulate" + ] + } + }, + "response": [] + }, + { + "name": "Update Environment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var envRequest = JSON.parse(pm.request.body.raw);", + "", + "// reduce date for future assert", + "envRequest.date = envRequest.date.substring(0, envRequest.date.length - 7);", + "", + "// save environment parameters", + "pm.environment.set('env_id', apiRspn.new_env_id) ", + "pm.environment.set('latitude', envRequest.latitude)", + "pm.environment.set('longitude', envRequest.longitude)", + "pm.environment.set('elevation', envRequest.elevation) ", + "pm.environment.set('atmospheric_model_type', envRequest.atmospheric_model_type) ", + "pm.environment.set('atmospheric_model_file', envRequest.atmospheric_model_file) ", + "pm.environment.set('date', envRequest.date) ", + "", + "//TEST", + "bdd = \"Given a valid Environment PUT request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Environment successfully updated\");", + " });", + " pm.test(bdd + \" then response must contain a valid new_env_id\", function () {", + " pm.expect(apiRspn.new_env_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"latitude\": 0,\n \"longitude\": 0,\n \"elevation\": 1400,\n \"atmospheric_model_type\": \"standard_atmosphere\",\n \"atmospheric_model_file\": \"GFS\",\n \"date\": \"2023-05-09T16:30:50.065992\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/environments/{{env_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "environments", + "{{env_id}}" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Delete Environment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "//TEST", + "bdd = \"Given a valid Environment DELETE request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Environment successfully deleted\", \"message not matching\");", + " pm.expect(apiRspn.deleted_env_id).to.eql(pm.environment.get('env_id'), \"env_id not matching\"); ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{endpoint}}/environments/{{env_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "environments", + "{{env_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Flight", + "item": [ + { + "name": "Create Flight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var flightRequest = JSON.parse(pm.request.body.raw);", + "", + "// reduce environment date for future assertion", + "flightRequest.environment.date = flightRequest.environment.date.substring(0, flightRequest.environment.date.length - 7);", + "", + "// save flight parameters", + "pm.environment.set('rail_length', flightRequest.rail_length) ", + "pm.environment.set('inclination', flightRequest.inclination)", + "pm.environment.set('heading', flightRequest.heading)", + "", + "// flight environment", + "pm.environment.set('flight_id', apiRspn.flight_id) ", + "pm.environment.set('latitude', flightRequest.environment.latitude)", + "pm.environment.set('longitude', flightRequest.environment.longitude)", + "pm.environment.set('elevation', flightRequest.environment.elevation) ", + "pm.environment.set('atmospheric_model_type', flightRequest.environment.atmospheric_model_type) ", + "pm.environment.set('atmospheric_model_file', flightRequest.environment.atmospheric_model_file) ", + "pm.environment.set('date', flightRequest.environment.date) ", + "", + "// flight rocket", + "pm.environment.set('radius', flightRequest.rocket.radius)", + "pm.environment.set('mass', flightRequest.rocket.mass)", + "pm.environment.set('inertia', flightRequest.rocket.inertia)", + "pm.environment.set('power_off_drag', flightRequest.rocket.power_off_drag)", + "pm.environment.set('power_on_drag', flightRequest.rocket.power_on_drag)", + "pm.environment.set('center_of_mass_without_motor', flightRequest.rocket.center_of_mass_without_motor)", + "pm.environment.set('motor_position', flightRequest.rocket.motor_position)", + "pm.environment.set('rail_buttons', flightRequest.rocket.rail_buttons)", + "pm.environment.set('upper_button_position', flightRequest.rocket.rail_buttons.upper_button_position)", + "pm.environment.set('lower_button_position', flightRequest.rocket.rail_buttons.lower_button_position)", + "pm.environment.set('angular_position', flightRequest.rocket.rail_buttons.angular_position)", + "pm.environment.set('rocket_coordinate_system_orientation', flightRequest.rocket.coordinate_system_orientation)", + "", + "// flight rocket motor", + "pm.environment.set('burn_time', flightRequest.rocket.motor.burn_time)", + "pm.environment.set('dry_mass', flightRequest.rocket.motor.dry_mass)", + "pm.environment.set('dry_inertia', flightRequest.rocket.motor.dry_inertia)", + "pm.environment.set('center_of_dry_mass_position', flightRequest.rocket.motor.center_of_dry_mass_position)", + "pm.environment.set('grain_number', flightRequest.rocket.motor.grain_number)", + "pm.environment.set('grain_density', flightRequest.rocket.motor.grain_density)", + "pm.environment.set('grain_outer_radius', flightRequest.rocket.motor.grain_outer_radius)", + "pm.environment.set('grain_initial_inner_radius', flightRequest.rocket.motor.grain_initial_inner_radius)", + "pm.environment.set('grain_initial_height', flightRequest.rocket.motor.grain_initial_height)", + "pm.environment.set('grains_center_of_mass_position', flightRequest.rocket.motor.grains_center_of_mass_position)", + "pm.environment.set('grain_separation', flightRequest.rocket.motor.grain_separation)", + "pm.environment.set('thrust_source', flightRequest.rocket.motor.thrust_source)", + "pm.environment.set('nozzle_radius', flightRequest.rocket.motor.nozzle_radius)", + "pm.environment.set('throat_radius', flightRequest.rocket.motor.throat_radius)", + "pm.environment.set('interpolation_method', flightRequest.rocket.motor.interpolation_method)", + "pm.environment.set('motor_coordinate_system_orientation', flightRequest.rocket.motor.coordinate_system_orientation)", + "", + "// flight rocket nose", + "pm.environment.set('nose_length', flightRequest.rocket.nose.length)", + "pm.environment.set('kind', flightRequest.rocket.nose.kind)", + "pm.environment.set('nose_position', flightRequest.rocket.nose.position)", + "pm.environment.set('base_radius', flightRequest.rocket.nose.base_radius)", + "pm.environment.set('rocket_radius', flightRequest.rocket.nose.rocket_radius)", + "", + "// flight rocket fins", + "pm.environment.set('n', flightRequest.rocket.fins.n)", + "pm.environment.set('root_chord', flightRequest.rocket.fins.root_chord)", + "pm.environment.set('tip_chord', flightRequest.rocket.fins.tip_chord)", + "pm.environment.set('span', flightRequest.rocket.fins.span)", + "pm.environment.set('fin_position', flightRequest.rocket.fins.position)", + "pm.environment.set('cant_angle', flightRequest.rocket.fins.cant_angle)", + "pm.environment.set('fin_radius', flightRequest.rocket.fins.radius)", + "pm.environment.set('airfoil', flightRequest.rocket.fins.airfoil)", + "", + "// flight rocket tail", + "pm.environment.set('top_radius', flightRequest.rocket.tail.top_radius)", + "pm.environment.set('bottom_radius', flightRequest.rocket.tail.bottom_radius)", + "pm.environment.set('tail_length', flightRequest.rocket.tail.length)", + "pm.environment.set('tail_position', flightRequest.rocket.tail.position)", + "pm.environment.set('tail_radius', flightRequest.rocket.tail.radius)", + "", + "// flight rocket parachute", + "pm.environment.set('parachutes_names', flightRequest.rocket.parachutes.name)", + "pm.environment.set('parachutes_cds', flightRequest.rocket.parachutes.cd_s)", + "pm.environment.set('parachutes_sampling_rate', flightRequest.rocket.parachutes.sampling_rate)", + "pm.environment.set('parachutes_lags', flightRequest.rocket.parachutes.lag)", + "pm.environment.set('parachutes_noises', flightRequest.rocket.parachutes.noise)", + "pm.environment.set('parachutes_triggers', flightRequest.rocket.parachutes.triggers)", + "", + "//TEST", + "bdd = \"Given a valid Flight POST request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Flight successfully created\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight_id\", function () {", + " pm.expect(apiRspn.flight_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"rail_length\": 5.2,\n \"inclination\": 85,\n \"heading\": 0,\n \"environment\": {\n \"latitude\": 0,\n \"longitude\": 0,\n \"elevation\": 1405,\n \"atmospheric_model_type\": \"standard_atmosphere\",\n \"atmospheric_model_file\": \"GFS\",\n \"date\": \"2023-05-09T16:30:50.065992\"\n },\n \"rocket\": {\n \"radius\": 0.0632,\n \"mass\": 16.235,\n \"inertia\": [\n 6.321, \n 6.321, \n 0.0346\n ],\n \"power_off_drag\": \"calisto\",\n \"power_on_drag\": \"calisto\",\n \"center_of_mass_without_motor\": 0,\n \"coordinate_system_orientation\": \"tail_to_nose\",\n \"motor_position\": -1.255,\n \"rail_buttons\": {\n \"upper_button_position\": -0.5,\n \"lower_button_position\": 0.2,\n \"angular_position\": 45\n },\n \"motor\": {\n \"burn_time\": 3.9,\n \"dry_mass\": 1.815,\n \"dry_inertia\": [0.125, 0.125, 0.002],\n \"center_of_dry_mass_position\": 0.317,\n \"grain_number\": 5,\n \"grain_density\": 1815,\n \"grain_outer_radius\": 0.033,\n \"grain_initial_inner_radius\": 0.015,\n \"grain_initial_height\": 0.12,\n \"grains_center_of_mass_position\": -0.85704,\n \"grain_separation\": 0.005,\n \"thrust_source\": \"Cesaroni_M1670\", \n \"nozzle_radius\": 0.033,\n \"throat_radius\": 0.011,\n \"interpolation_method\": \"linear\",\n \"coordinate_system_orientation\": \"nozzle_to_combustion_chamber\"\n },\n \"nose\": {\n \"length\": 0.55829,\n \"kind\": \"vonKarman\",\n \"position\": 1.278,\n \"base_radius\": 0.0635,\n \"rocket_radius\": 0.0635\n },\n \"fins\": {\n \"n\": 4,\n \"root_chord\": 0.12,\n \"tip_chord\": 0.04,\n \"span\": 0.1,\n \"position\": -1.04956,\n \"cant_angle\": 0,\n \"radius\": 0.0635,\n \"airfoil\": \"\"\n },\n \"tail\": {\n \"top_radius\": 0.0635,\n \"bottom_radius\": 0.0435,\n \"length\": 0.06,\n \"position\": -1.194656,\n \"radius\": 0.0635\n },\n \"parachutes\": {\n \"name\": [\n \"Main\",\n \"Drogue\"\n ],\n \"cd_s\": [\n 10,\n 1\n ],\n \"sampling_rate\": [\n 105,\n 105\n ],\n \"lag\": [\n 1.5,\n 1.5\n ],\n \"noise\": [\n [\n 0,\n 8.3,\n 0.5\n ],\n [\n 0,\n 8.3,\n 0.5\n ]\n ],\n \"triggers\": [\n \"lambda p, h, y: y[5] < 0 and h < 800\",\n \"lambda p, h, y: y[5] < 0\"\n ]\n }\n } \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/flights/", + "host": [ + "{{endpoint}}" + ], + "path": [ + "flights", + "" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Read Flight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "", + "var returned_date = apiRspn.environment.date;", + "var reduced_returned_date = returned_date.substring(0, returned_date.length - 7);", + "", + "//TEST", + "bdd = \"Given a valid Flight GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid flight \", function () {", + " pm.expect(apiRspn.inclination).to.eql(pm.environment.get('inclination'), \"flight inclination not matching\");", + " pm.expect(apiRspn.heading).to.eql(pm.environment.get('heading'), \"flight heading not matching\");", + " pm.expect(apiRspn.rail_length).to.eql(pm.environment.get('rail_length'), \"flight rail_length not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight environment\", function () {", + " pm.expect(apiRspn.environment.longitude).to.eql(pm.environment.get('longitude'), \"environment longitude not matching\"); ", + " pm.expect(apiRspn.environment.elevation).to.eql(pm.environment.get('elevation'), \"environment elevation not matching\");", + " pm.expect(apiRspn.environment.atmospheric_model_type).to.eql(pm.environment.get('atmospheric_model_type'), \"environment atmospheric_model_type not matching\");", + " pm.expect(apiRspn.environment.atmospheric_model_file).to.eql(pm.environment.get('atmospheric_model_file'), \"environment atmospheric_model_file not matching\");", + " pm.expect(reduced_returned_date).to.eql(pm.environment.get('date'), \"date not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket\", function () { ", + " pm.expect(apiRspn.rocket.radius).to.eql(pm.environment.get('radius'), \"rocket radius not matching\");", + " pm.expect(apiRspn.rocket.mass).to.eql(pm.environment.get('mass'), \"rocket mass not matching\");", + " pm.expect(apiRspn.rocket.inertia).to.eql(pm.environment.get('inertia'), \"rocket inertia not matching\");", + " pm.expect(apiRspn.rocket.power_off_drag).to.eql(pm.environment.get('power_off_drag'), \"rocket power_off_drag not matching\");", + " pm.expect(apiRspn.rocket.power_on_drag).to.eql(pm.environment.get('power_on_drag'), \"rocket power_on_drag not matching\");", + " pm.expect(apiRspn.rocket.center_of_mass_without_motor).to.eql(pm.environment.get('center_of_mass_without_motor'), \"rocket center_of_mass_without_motor not matching\");", + " pm.expect(apiRspn.rocket.coordinate_system_orientation).to.eql(pm.environment.get('rocket_coordinate_system_orientation'), \"rocket coordinate_system_orientation not matching\");", + " pm.expect(apiRspn.rocket.motor_position).to.eql(pm.environment.get('motor_position'), \"rocket motor_position not matching\");", + " pm.expect(apiRspn.rocket.rail_buttons).to.eql(pm.environment.get('rail_buttons'), \"rocket rail_buttons not matching\");", + " pm.expect(apiRspn.rocket.rail_buttons.upper_button_position).to.eql(pm.environment.get('upper_button_position'), \"rocket rail_buttons upper_button_position not matching\");", + " pm.expect(apiRspn.rocket.rail_buttons.lower_button_position).to.eql(pm.environment.get('lower_button_position'), \"rocket rail_buttons lower_button_position not matching\");", + " pm.expect(apiRspn.rocket.rail_buttons.angular_position).to.eql(pm.environment.get('angular_position'), \"rocket rail_buttons angular_position not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket motor\", function () {", + " pm.expect(apiRspn.rocket.motor.burn_time).to.eql(pm.environment.get('burn_time'), \"rocket motor burn_time not matching\");", + " pm.expect(apiRspn.rocket.motor.dry_mass).to.eql(pm.environment.get('dry_mass'), \"rocket motor dry_mass not matching\");", + " pm.expect(apiRspn.rocket.motor.dry_inertia).to.eql(pm.environment.get('dry_inertia'), \"rocket motor dry_inertia not matching\");", + " pm.expect(apiRspn.rocket.motor.center_of_dry_mass_position).to.eql(pm.environment.get('center_of_dry_mass_position'), \"rocket motor center_of_dry_mass_position not matching\");", + " pm.expect(apiRspn.rocket.motor.grain_number).to.eql(pm.environment.get('grain_number'), \"rocket motor grain_number not matching\");", + " pm.expect(apiRspn.rocket.motor.grain_density).to.eql(pm.environment.get('grain_density'), \"rocket motor grain_density not matching\");", + " pm.expect(apiRspn.rocket.motor.grain_outer_radius).to.eql(pm.environment.get('grain_outer_radius'), \"rocket motor grain_outer_radius not matching\");", + " pm.expect(apiRspn.rocket.motor.grain_initial_inner_radius).to.eql(pm.environment.get('grain_initial_inner_radius'), \"rocket motor grain_initial_inner_radius not matching\");", + " pm.expect(apiRspn.rocket.motor.grain_initial_height).to.eql(pm.environment.get('grain_initial_height'), \"rocket motor grain_initial_height not matching\");", + " pm.expect(apiRspn.rocket.motor.grains_center_of_mass_position).to.eql(pm.environment.get('grains_center_of_mass_position'), \"rocket motor grains_center_of_mass_position not matching\");", + " pm.expect(apiRspn.rocket.motor.thrust_source).to.eql(pm.environment.get('thrust_source'), \"rocket motor thrust_source not matching\");", + " pm.expect(apiRspn.rocket.motor.grain_separation).to.eql(pm.environment.get('grain_separation'), \"rocket motor grain_separation not matching\");", + " pm.expect(apiRspn.rocket.motor.nozzle_radius).to.eql(pm.environment.get('nozzle_radius'), \"rocket motor nozzle_radius not matching\");", + " pm.expect(apiRspn.rocket.motor.throat_radius).to.eql(pm.environment.get('throat_radius'), \"rocket motor throat_radius not matching\");", + " pm.expect(apiRspn.rocket.motor.interpolation_method).to.eql(pm.environment.get('interpolation_method'), \"rocket motor interpolation_method not matching\");", + " pm.expect(apiRspn.rocket.motor.coordinate_system_orientation).to.eql(pm.environment.get('motor_coordinate_system_orientation'), \"motor coordinate_system_orientation not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket nose\", function () {", + " pm.expect(apiRspn.rocket.nose.length).to.eql(pm.environment.get('nose_length'), \"rocket nose length not matching\");", + " pm.expect(apiRspn.rocket.nose.kind).to.eql(pm.environment.get('kind'), \"rocket nose kind not matching\");", + " pm.expect(apiRspn.rocket.nose.position).to.eql(pm.environment.get('nose_position'), \"rocket nose position not matching\");", + " pm.expect(apiRspn.rocket.nose.base_radius).to.eql(pm.environment.get('base_radius'), \"rocket nose base_radius not matching\");", + " pm.expect(apiRspn.rocket.nose.rocket_radius).to.eql(pm.environment.get('rocket_radius'), \"rocket nose rocket_radius not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket fins\", function () {", + " pm.expect(apiRspn.rocket.fins.n).to.eql(pm.environment.get('n'), \"rocket fins 'n' not matching\");", + " pm.expect(apiRspn.rocket.fins.root_chord).to.eql(pm.environment.get('root_chord'), \"rocket fins root_chord not matching\");", + " pm.expect(apiRspn.rocket.fins.tip_chord).to.eql(pm.environment.get('tip_chord'), \"rocket fins tip_chord not matching\");", + " pm.expect(apiRspn.rocket.fins.span).to.eql(pm.environment.get('span'), \"rocket fins span not matching\");", + " pm.expect(apiRspn.rocket.fins.position).to.eql(pm.environment.get('fin_position'), \"rocket fins position not matching\");", + " pm.expect(apiRspn.rocket.fins.cant_angle).to.eql(pm.environment.get('cant_angle'), \"rocket fins cant_angle not matching\");", + " pm.expect(apiRspn.rocket.fins.radius).to.eql(pm.environment.get('fin_radius'), \"rocket fins radius not matching\");", + " pm.expect(apiRspn.rocket.fins.airfoil).to.eql(pm.environment.get('airfoil'), \"rocket fins airfoil not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket tail\", function () {", + " pm.expect(apiRspn.rocket.tail.top_radius).to.eql(pm.environment.get('top_radius'), \"rocket tail top_radius not matching\"); ", + " pm.expect(apiRspn.rocket.tail.bottom_radius).to.eql(pm.environment.get('bottom_radius'), \"rocket tail bottom_radius not matching\"); ", + " pm.expect(apiRspn.rocket.tail.length).to.eql(pm.environment.get('tail_length'), \"rocket tail length not matching\"); ", + " pm.expect(apiRspn.rocket.tail.position).to.eql(pm.environment.get('tail_position'), \"rocket tail position not matching\"); ", + " pm.expect(apiRspn.rocket.tail.radius).to.eql(pm.environment.get('tail_radius'), \"rocket tail radius not matching\"); ", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket parachutes\", function () {", + " pm.expect(apiRspn.rocket.parachutes.name).to.eql(pm.environment.get('parachutes_names'), \"rocket parachutes names not matching\"); ", + " pm.expect(apiRspn.rocket.parachutes.cd_s).to.eql(pm.environment.get('parachutes_cds'), \"rocket parachutes cd_s not matching\"); ", + " pm.expect(apiRspn.rocket.parachutes.sampling_rate).to.eql(pm.environment.get('parachutes_sampling_rate'), \"rocket parachutes sampling_rate not matching\"); ", + " pm.expect(apiRspn.rocket.parachutes.lag).to.eql(pm.environment.get('parachutes_lags'), \"rocket parachutes lags not matching\"); ", + " pm.expect(apiRspn.rocket.parachutes.noise).to.eql(pm.environment.get('parachutes_noises'), \"rocket parachutes noises not matching\");", + " pm.expect(apiRspn.rocket.parachutes.triggers).to.eql(pm.environment.get('parachutes_triggers'), \"rocket parachutes triggers not matching\");", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/flights/{{flight_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "flights", + "{{flight_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Read rocketpy Flight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "", + "//TEST", + "bdd = \"Given a valid rocketpy Flight GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.jsonpickle_rocketpy_flight).to.exist; ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/flights/rocketpy/{{flight_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "flights", + "rocketpy", + "{{flight_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Simulate Flight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "//TEST", + "bdd = \"Given a valid rocketpy Flight simulate GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.flight_data).to.exist;", + " pm.expect(apiRspn.flight_data.initial_conditions).to.exist;", + " pm.expect(apiRspn.flight_data.initial_conditions.initial_position).to.exist;", + " pm.expect(apiRspn.flight_data.initial_conditions.initial_velocity).to.exist;", + " pm.expect(apiRspn.flight_data.initial_conditions.initial_altitude).to.exist;", + " pm.expect(apiRspn.flight_data.initial_conditions.initial_angular_position).to.exist;", + " pm.expect(apiRspn.flight_data.initial_conditions.initial_angular_velocity).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.max_time).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.max_time_step).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.min_time_step).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.relative_error_tolerance).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.absolute_error_tolerance).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.time_overshoot).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.terminate_on_apogee).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.number_of_time_steps).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.function_evaluations_per_time_step).to.exist;", + " pm.expect(apiRspn.flight_data.numerical_integration_settings.avg_function_evaluations_per_time_step).to.exist;", + " pm.expect(apiRspn.flight_data.launch_rail_conditions).to.exist;", + " pm.expect(apiRspn.flight_data.launch_rail_conditions.rail_length).to.exist;", + " pm.expect(apiRspn.flight_data.launch_rail_conditions.flight_inclination).to.exist;", + " pm.expect(apiRspn.flight_data.launch_rail_conditions.flight_heading).to.exist;", + " pm.expect(apiRspn.flight_data.surface_wind_conditions).to.exist;", + " pm.expect(apiRspn.flight_data.surface_wind_conditions.frontal_surface_wind_speed).to.exist;", + " pm.expect(apiRspn.flight_data.surface_wind_conditions.lateral_surface_wind_speed).to.exist;", + " pm.expect(apiRspn.flight_data.out_of_rail_conditions).to.exist;", + " pm.expect(apiRspn.flight_data.out_of_rail_conditions.out_of_rail_time).to.exist;", + " pm.expect(apiRspn.flight_data.out_of_rail_conditions.out_of_rail_velocity).to.exist;", + " pm.expect(apiRspn.flight_data.out_of_rail_conditions.out_of_rail_static_margin).to.exist;", + " pm.expect(apiRspn.flight_data.out_of_rail_conditions.out_of_rail_angle_of_attack).to.exist;", + " pm.expect(apiRspn.flight_data.out_of_rail_conditions.out_of_rail_thrust_weight_ratio).to.exist;", + " pm.expect(apiRspn.flight_data.out_of_rail_conditions.out_of_rail_reynolds_number).to.exist;", + " pm.expect(apiRspn.flight_data.burnout_conditions).to.exist;", + " pm.expect(apiRspn.flight_data.burnout_conditions.burnout_time).to.exist;", + " pm.expect(apiRspn.flight_data.burnout_conditions.burnout_rocket_velocity).to.exist;", + " pm.expect(apiRspn.flight_data.burnout_conditions.burnout_altitude).to.exist;", + " pm.expect(apiRspn.flight_data.burnout_conditions.burnout_freestream_velocity).to.exist;", + " pm.expect(apiRspn.flight_data.burnout_conditions.burnout_mach_number).to.exist;", + " pm.expect(apiRspn.flight_data.burnout_conditions.burnout_kinetic_energy).to.exist;", + " pm.expect(apiRspn.flight_data.apogee_conditions).to.exist;", + " pm.expect(apiRspn.flight_data.apogee_conditions.apogee_time).to.exist;", + " pm.expect(apiRspn.flight_data.apogee_conditions.apogee_altitude).to.exist;", + " pm.expect(apiRspn.flight_data.apogee_conditions.apogee_freestream_speed).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_speed).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_mach_number).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_reynolds_number).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_dynamic_pressure).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_acceleration_during_motor_burn).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_acceleration_after_motor_burn).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_gs_during_motor_burn).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_gs_after_motor_burn).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_upper_rail_button_normal_force).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_upper_rail_button_shear_force).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_lower_rail_button_normal_force).to.exist;", + " pm.expect(apiRspn.flight_data.maximum_values.maximum_lower_rail_button_shear_force).to.exist;", + " pm.expect(apiRspn.flight_data.impact_conditions).to.exist;", + " pm.expect(apiRspn.flight_data.impact_conditions.x_impact_position).to.exist;", + " pm.expect(apiRspn.flight_data.impact_conditions.y_impact_position).to.exist;", + " pm.expect(apiRspn.flight_data.impact_conditions.time_of_impact).to.exist;", + " pm.expect(apiRspn.flight_data.impact_conditions.impact_velocity).to.exist;", + " pm.expect(apiRspn.flight_data.events_registered).to.exist;", + " pm.expect(apiRspn.flight_data.events_registered.events_trace).to.exist;", + " pm.expect(apiRspn.flight_data.events_registered.events_trace.Drogue).to.exist;", + " pm.expect(apiRspn.flight_data.events_registered.events_trace.Main).to.exist; ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/flights/{{flight_id}}/simulate", + "host": [ + "{{endpoint}}" + ], + "path": [ + "flights", + "{{flight_id}}", + "simulate" + ] + } + }, + "response": [] + }, + { + "name": "Update Flight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var flightRequest = JSON.parse(pm.request.body.raw);", + "", + "// reduce environment date for future assertion", + "flightRequest.environment.date = flightRequest.environment.date.substring(0, flightRequest.environment.date.length - 7);", + "", + "// save flight parameters", + "pm.environment.set('flight_id', apiRspn.new_flight_id) ", + "pm.environment.set('rail_length', flightRequest.rail_length) ", + "pm.environment.set('inclination', flightRequest.inclination)", + "pm.environment.set('heading', flightRequest.heading)", + "", + "// flight environment", + "pm.environment.set('latitude', flightRequest.environment.latitude)", + "pm.environment.set('longitude', flightRequest.environment.longitude)", + "pm.environment.set('elevation', flightRequest.environment.elevation) ", + "pm.environment.set('atmospheric_model_type', flightRequest.environment.atmospheric_model_type) ", + "pm.environment.set('atmospheric_model_file', flightRequest.environment.atmospheric_model_file) ", + "pm.environment.set('date', flightRequest.environment.date) ", + "", + "// flight rocket", + "pm.environment.set('radius', flightRequest.rocket.radius)", + "pm.environment.set('mass', flightRequest.rocket.mass)", + "pm.environment.set('inertia', flightRequest.rocket.inertia)", + "pm.environment.set('power_off_drag', flightRequest.rocket.power_off_drag)", + "pm.environment.set('power_on_drag', flightRequest.rocket.power_on_drag)", + "pm.environment.set('center_of_mass_without_motor', flightRequest.rocket.center_of_mass_without_motor)", + "pm.environment.set('motor_position', flightRequest.rocket.motor_position)", + "pm.environment.set('rail_buttons', flightRequest.rocket.rail_buttons)", + "pm.environment.set('upper_button_position', flightRequest.rocket.rail_buttons.upper_button_position)", + "pm.environment.set('lower_button_position', flightRequest.rocket.rail_buttons.lower_button_position)", + "pm.environment.set('angular_position', flightRequest.rocket.rail_buttons.angular_position)", + "pm.environment.set('rocket_coordinate_system_orientation', flightRequest.rocket.coordinate_system_orientation)", + "", + "// flight rocket motor", + "pm.environment.set('burn_time', flightRequest.rocket.motor.burn_time)", + "pm.environment.set('dry_mass', flightRequest.rocket.motor.dry_mass)", + "pm.environment.set('dry_inertia', flightRequest.rocket.motor.dry_inertia)", + "pm.environment.set('center_of_dry_mass_position', flightRequest.rocket.motor.center_of_dry_mass_position)", + "pm.environment.set('grain_number', flightRequest.rocket.motor.grain_number)", + "pm.environment.set('grain_density', flightRequest.rocket.motor.grain_density)", + "pm.environment.set('grain_outer_radius', flightRequest.rocket.motor.grain_outer_radius)", + "pm.environment.set('grain_initial_inner_radius', flightRequest.rocket.motor.grain_initial_inner_radius)", + "pm.environment.set('grain_initial_height', flightRequest.rocket.motor.grain_initial_height)", + "pm.environment.set('grains_center_of_mass_position', flightRequest.rocket.motor.grains_center_of_mass_position)", + "pm.environment.set('grain_separation', flightRequest.rocket.motor.grain_separation)", + "pm.environment.set('thrust_source', flightRequest.rocket.motor.thrust_source)", + "pm.environment.set('nozzle_radius', flightRequest.rocket.motor.nozzle_radius)", + "pm.environment.set('throat_radius', flightRequest.rocket.motor.throat_radius)", + "pm.environment.set('interpolation_method', flightRequest.rocket.motor.interpolation_method)", + "pm.environment.set('motor_coordinate_system_orientation', flightRequest.rocket.motor.coordinate_system_orientation)", + "", + "// flight rocket nose", + "pm.environment.set('nose_length', flightRequest.rocket.nose.length)", + "pm.environment.set('kind', flightRequest.rocket.nose.kind)", + "pm.environment.set('nose_position', flightRequest.rocket.nose.position)", + "pm.environment.set('base_radius', flightRequest.rocket.nose.base_radius)", + "pm.environment.set('rocket_radius', flightRequest.rocket.nose.rocket_radius)", + "", + "// flight rocket fins", + "pm.environment.set('n', flightRequest.rocket.fins.n)", + "pm.environment.set('root_chord', flightRequest.rocket.fins.root_chord)", + "pm.environment.set('tip_chord', flightRequest.rocket.fins.tip_chord)", + "pm.environment.set('span', flightRequest.rocket.fins.span)", + "pm.environment.set('fin_position', flightRequest.rocket.fins.position)", + "pm.environment.set('cant_angle', flightRequest.rocket.fins.cant_angle)", + "pm.environment.set('fin_radius', flightRequest.rocket.fins.radius)", + "pm.environment.set('airfoil', flightRequest.rocket.fins.airfoil)", + "", + "// flight rocket tail", + "pm.environment.set('top_radius', flightRequest.rocket.tail.top_radius)", + "pm.environment.set('bottom_radius', flightRequest.rocket.tail.bottom_radius)", + "pm.environment.set('tail_length', flightRequest.rocket.tail.length)", + "pm.environment.set('tail_position', flightRequest.rocket.tail.position)", + "pm.environment.set('tail_radius', flightRequest.rocket.tail.radius)", + "", + "// flight rocket parachute", + "pm.environment.set('parachutes_names', flightRequest.rocket.parachutes.name)", + "pm.environment.set('parachutes_cds', flightRequest.rocket.parachutes.cd_s)", + "pm.environment.set('parachutes_sampling_rate', flightRequest.rocket.parachutes.sampling_rate)", + "pm.environment.set('parachutes_lags', flightRequest.rocket.parachutes.lag)", + "pm.environment.set('parachutes_noises', flightRequest.rocket.parachutes.noise)", + "pm.environment.set('parachutes_triggers', flightRequest.rocket.parachutes.triggers)", + "", + "//TEST", + "bdd = \"Given a valid Flight PUT request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Flight successfully updated\");", + " });", + " pm.test(bdd + \" then response must contain a valid new_flight_id\", function () {", + " pm.expect(apiRspn.new_flight_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"rail_length\": 5.2,\n \"inclination\": 85,\n \"heading\": 0,\n \"environment\": {\n \"latitude\": 0,\n \"longitude\": 0,\n \"elevation\": 1405,\n \"atmospheric_model_type\": \"standard_atmosphere\",\n \"atmospheric_model_file\": \"GFS\",\n \"date\": \"2023-05-09T16:30:50.065992\"\n },\n \"rocket\": {\n \"radius\": 0.0632,\n \"mass\": 16.235,\n \"inertia\": [\n 6.321, \n 6.321, \n 0.0346\n ],\n \"power_off_drag\": \"calisto\",\n \"power_on_drag\": \"calisto\",\n \"center_of_mass_without_motor\": 0,\n \"coordinate_system_orientation\": \"tail_to_nose\",\n \"motor_position\": -1.255,\n \"rail_buttons\": {\n \"upper_button_position\": -0.5,\n \"lower_button_position\": 0.2,\n \"angular_position\": 45\n },\n \"motor\": {\n \"burn_time\": 3.9,\n \"dry_mass\": 1.815,\n \"dry_inertia\": [0.125, 0.125, 0.002],\n \"center_of_dry_mass_position\": 0.317,\n \"grain_number\": 5,\n \"grain_density\": 1815,\n \"grain_outer_radius\": 0.033,\n \"grain_initial_inner_radius\": 0.015,\n \"grain_initial_height\": 0.12,\n \"grains_center_of_mass_position\": -0.85704,\n \"grain_separation\": 0.005,\n \"thrust_source\": \"Cesaroni_M1670\", \n \"nozzle_radius\": 0.033,\n \"throat_radius\": 0.011,\n \"interpolation_method\": \"linear\",\n \"coordinate_system_orientation\": \"nozzle_to_combustion_chamber\"\n },\n \"nose\": {\n \"length\": 0.55829,\n \"kind\": \"vonKarman\",\n \"position\": 1.278,\n \"base_radius\": 0.0635,\n \"rocket_radius\": 0.0635\n },\n \"fins\": {\n \"n\": 4,\n \"root_chord\": 0.12,\n \"tip_chord\": 0.04,\n \"span\": 0.1,\n \"position\": -1.04956,\n \"cant_angle\": 0,\n \"radius\": 0.0635,\n \"airfoil\": \"\"\n },\n \"tail\": {\n \"top_radius\": 0.0635,\n \"bottom_radius\": 0.0435,\n \"length\": 0.06,\n \"position\": -1.194656,\n \"radius\": 0.0635\n },\n \"parachutes\": {\n \"name\": [\n \"Main\",\n \"Drogue\"\n ],\n \"cd_s\": [\n 10,\n 1\n ],\n \"sampling_rate\": [\n 105,\n 105\n ],\n \"lag\": [\n 1.5,\n 1.5\n ],\n \"noise\": [\n [\n 0,\n 8.3,\n 0.5\n ],\n [\n 0,\n 8.3,\n 0.5\n ]\n ],\n \"triggers\": [\n \"lambda p, h, y: y[5] < 0 and h < 800\",\n \"lambda p, h, y: y[5] < 0\"\n ]\n }\n } \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/flights/{{flight_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "flights", + "{{flight_id}}" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Update Flight Environment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var flightRequest = JSON.parse(pm.request.body.raw);", + "", + "// save new flight id", + "pm.environment.set('flight_id', apiRspn.new_flight_id) ", + "", + "// save environment parameters", + "pm.environment.set('env_id', apiRspn.new_env_id) ", + "pm.environment.set('latitude', flightRequest.latitude)", + "pm.environment.set('longitude', flightRequest.longitude)", + "pm.environment.set('elevation', flightRequest.elevation) ", + "pm.environment.set('atmospheric_model_type', flightRequest.atmospheric_model_type) ", + "pm.environment.set('atmospheric_model_file', flightRequest.atmospheric_model_file) ", + "pm.environment.set('date', flightRequest.date) ", + "", + "//TEST", + "bdd = \"Given a valid Flight PUT request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Flight successfully updated\");", + " });", + " pm.test(bdd + \" then response must contain a valid new_flight_id\", function () {", + " pm.expect(apiRspn.new_flight_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"latitude\": 0,\n \"longitude\": 0,\n \"elevation\": 1400,\n \"atmospheric_model_type\": \"standard_atmosphere\",\n \"atmospheric_model_file\": \"GFS\",\n \"date\": \"2023-05-09T16:30:50.065992\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/flights/{{flight_id}}/env", + "host": [ + "{{endpoint}}" + ], + "path": [ + "flights", + "{{flight_id}}", + "env" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Update Flight Rocket", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var flightRequest = JSON.parse(pm.request.body.raw);", + "", + "// save new flight id", + "pm.environment.set('flight_id', apiRspn.new_flight_id) ", + "", + "// save rocket parameters", + "pm.environment.set('rocket_id', apiRspn.new_rocket_id)", + "pm.environment.set('radius', flightRequest.radius)", + "pm.environment.set('mass', flightRequest.mass)", + "pm.environment.set('inertia', flightRequest.inertia)", + "pm.environment.set('power_off_drag', flightRequest.power_off_drag)", + "pm.environment.set('power_on_drag', flightRequest.power_on_drag)", + "pm.environment.set('center_of_mass_without_motor', flightRequest.center_of_mass_without_motor)", + "pm.environment.set('motor_position', flightRequest.motor_position)", + "pm.environment.set('rail_buttons', flightRequest.rail_buttons)", + "pm.environment.set('upper_button_position', flightRequest.rail_buttons.upper_button_position)", + "pm.environment.set('lower_button_position', flightRequest.rail_buttons.lower_button_position)", + "pm.environment.set('angular_position', flightRequest.rail_buttons.angular_position)", + "pm.environment.set('rocket_coordinate_system_orientation', flightRequest.coordinate_system_orientation)", + "", + "// rocket motor", + "pm.environment.set('burn_time', flightRequest.motor.burn_time)", + "pm.environment.set('dry_mass', flightRequest.motor.dry_mass)", + "pm.environment.set('dry_inertia', flightRequest.motor.dry_inertia)", + "pm.environment.set('center_of_dry_mass_position', flightRequest.motor.center_of_dry_mass_position)", + "pm.environment.set('grain_number', flightRequest.motor.grain_number)", + "pm.environment.set('grain_density', flightRequest.motor.grain_density)", + "pm.environment.set('grain_outer_radius', flightRequest.motor.grain_outer_radius)", + "pm.environment.set('grain_initial_inner_radius', flightRequest.motor.grain_initial_inner_radius)", + "pm.environment.set('grain_initial_height', flightRequest.motor.grain_initial_height)", + "pm.environment.set('grains_center_of_mass_position', flightRequest.motor.grains_center_of_mass_position)", + "pm.environment.set('grain_separation', flightRequest.motor.grain_separation)", + "pm.environment.set('thrust_source', flightRequest.motor.thrust_source)", + "pm.environment.set('nozzle_radius', flightRequest.motor.nozzle_radius)", + "pm.environment.set('throat_radius', flightRequest.motor.throat_radius)", + "pm.environment.set('interpolation_method', flightRequest.motor.interpolation_method)", + "pm.environment.set('motor_coordinate_system_orientation', flightRequest.motor.coordinate_system_orientation)", + "", + "// rocket nose", + "pm.environment.set('nose_length', flightRequest.nose.length)", + "pm.environment.set('kind', flightRequest.nose.kind)", + "pm.environment.set('nose_position', flightRequest.nose.position)", + "pm.environment.set('base_radius', flightRequest.nose.base_radius)", + "pm.environment.set('rocket_radius', flightRequest.nose.rocket_radius)", + "", + "// rocket fins", + "pm.environment.set('n', flightRequest.fins.n)", + "pm.environment.set('root_chord', flightRequest.fins.root_chord)", + "pm.environment.set('tip_chord', flightRequest.fins.tip_chord)", + "pm.environment.set('span', flightRequest.fins.span)", + "pm.environment.set('fin_position', flightRequest.fins.position)", + "pm.environment.set('cant_angle', flightRequest.fins.cant_angle)", + "pm.environment.set('fin_radius', flightRequest.fins.radius)", + "pm.environment.set('airfoil', flightRequest.fins.airfoil)", + "", + "// rocket tail", + "pm.environment.set('top_radius', flightRequest.tail.top_radius)", + "pm.environment.set('bottom_radius', flightRequest.tail.bottom_radius)", + "pm.environment.set('tail_length', flightRequest.tail.length)", + "pm.environment.set('tail_position', flightRequest.tail.position)", + "pm.environment.set('tail_radius', flightRequest.tail.radius)", + "", + "// rocket parachute", + "pm.environment.set('parachutes_names', flightRequest.parachutes.name)", + "pm.environment.set('parachutes_cds', flightRequest.parachutes.cd_s)", + "pm.environment.set('parachutes_sampling_rate', flightRequest.parachutes.sampling_rate)", + "pm.environment.set('parachutes_lags', flightRequest.parachutes.lag)", + "pm.environment.set('parachutes_noises', flightRequest.parachutes.noise)", + "pm.environment.set('parachutes_triggers', flightRequest.parachutes.triggers)", + "", + "//TEST", + "bdd = \"Given a valid Flight PUT request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Flight successfully updated\");", + " });", + " pm.test(bdd + \" then response must contain a valid new_flight_id\", function () {", + " pm.expect(apiRspn.new_flight_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"radius\": 0.0632,\n \"mass\": 16.235,\n \"inertia\": [\n 6.321, \n 6.321, \n 0.0346\n ],\n \"power_off_drag\": \"calisto\",\n \"power_on_drag\": \"calisto\",\n \"center_of_mass_without_motor\": 0,\n \"coordinate_system_orientation\": \"tail_to_nose\",\n \"motor_position\": -1.255,\n \"rail_buttons\": {\n \"upper_button_position\": -0.5,\n \"lower_button_position\": 0.2,\n \"angular_position\": 45\n },\n \"motor\": {\n \"burn_time\": 3.9,\n \"dry_mass\": 1.815,\n \"dry_inertia\": [0.125, 0.125, 0.002],\n \"center_of_dry_mass_position\": 0.317,\n \"grain_number\": 5,\n \"grain_density\": 1815,\n \"grain_outer_radius\": 0.033,\n \"grain_initial_inner_radius\": 0.015,\n \"grain_initial_height\": 0.12,\n \"grains_center_of_mass_position\": -0.85704,\n \"grain_separation\": 0.005,\n \"thrust_source\": \"Cesaroni_M1670\", \n \"nozzle_radius\": 0.033,\n \"throat_radius\": 0.011,\n \"interpolation_method\": \"linear\",\n \"coordinate_system_orientation\": \"nozzle_to_combustion_chamber\"\n },\n \"nose\": {\n \"length\": 0.55829,\n \"kind\": \"vonKarman\",\n \"position\": 1.278,\n \"base_radius\": 0.0635,\n \"rocket_radius\": 0.0635\n },\n \"fins\": {\n \"n\": 4,\n \"root_chord\": 0.12,\n \"tip_chord\": 0.04,\n \"span\": 0.1,\n \"position\": -1.04956,\n \"cant_angle\": 0,\n \"radius\": 0.0635,\n \"airfoil\": \"\"\n },\n \"tail\": {\n \"top_radius\": 0.0635,\n \"bottom_radius\": 0.0435,\n \"length\": 0.06,\n \"position\": -1.194656,\n \"radius\": 0.0635\n },\n \"parachutes\": {\n \"name\": [\n \"Main\",\n \"Drogue\"\n ],\n \"cd_s\": [\n 10,\n 1\n ],\n \"sampling_rate\": [\n 105,\n 105\n ],\n \"lag\": [\n 1.5,\n 1.5\n ],\n \"noise\": [\n [\n 0,\n 8.3,\n 0.5\n ],\n [\n 0,\n 8.3,\n 0.5\n ]\n ],\n \"triggers\": [\n \"lambda p, h, y: y[5] < 0 and h < 800\",\n \"lambda p, h, y: y[5] < 0\"\n ]\n } \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/flights/{{flight_id}}/rocket", + "host": [ + "{{endpoint}}" + ], + "path": [ + "flights", + "{{flight_id}}", + "rocket" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Delete Flight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "//TEST", + "bdd = \"Given a valid Flight DELETE request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Flight successfully deleted\", \"message not matching\");", + " pm.expect(apiRspn.deleted_flight_id).to.eql(pm.environment.get('flight_id'), \"flight_id not matching\"); ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{endpoint}}/flights/{{flight_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "flights", + "{{flight_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Motor", + "item": [ + { + "name": "Create Motor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var motorRequest = JSON.parse(pm.request.body.raw);", + "", + "// save motor parameters", + "pm.environment.set('motor_id', apiRspn.motor_id) ", + "pm.environment.set('burn_time', motorRequest.burn_time)", + "pm.environment.set('dry_mass', motorRequest.dry_mass)", + "pm.environment.set('dry_inertia', motorRequest.dry_inertia)", + "pm.environment.set('center_of_dry_mass_position', motorRequest.center_of_dry_mass_position)", + "pm.environment.set('grain_number', motorRequest.grain_number)", + "pm.environment.set('grain_density', motorRequest.grain_density)", + "pm.environment.set('grain_outer_radius', motorRequest.grain_outer_radius)", + "pm.environment.set('grain_initial_inner_radius', motorRequest.grain_initial_inner_radius)", + "pm.environment.set('grain_initial_height', motorRequest.grain_initial_height)", + "pm.environment.set('grains_center_of_mass_position', motorRequest.grains_center_of_mass_position)", + "pm.environment.set('grain_separation', motorRequest.grain_separation)", + "pm.environment.set('thrust_source', motorRequest.thrust_source)", + "pm.environment.set('nozzle_radius', motorRequest.nozzle_radius)", + "pm.environment.set('throat_radius', motorRequest.throat_radius)", + "pm.environment.set('interpolation_method', motorRequest.interpolation_method)", + "pm.environment.set('motor_coordinate_system_orientation', motorRequest.coordinate_system_orientation)", + "", + "//TEST", + "bdd = \"Given a valid Motor POST request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Motor successfully created\");", + " });", + " pm.test(bdd + \" then response must contain a valid motor_id\", function () {", + " pm.expect(apiRspn.motor_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"burn_time\": 3.9,\n \"dry_mass\": 1.815,\n \"dry_inertia\": [0.125, 0.125, 0.002],\n \"center_of_dry_mass_position\": 0.317,\n \"grain_number\": 5,\n \"grain_density\": 1815,\n \"grain_outer_radius\": 0.033,\n \"grain_initial_inner_radius\": 0.015,\n \"grain_initial_height\": 0.12,\n \"grains_center_of_mass_position\": -0.85704,\n \"grain_separation\": 0.005,\n \"thrust_source\": \"Cesaroni_M1670\", \n \"nozzle_radius\": 0.033,\n \"throat_radius\": 0.011,\n \"interpolation_method\": \"linear\",\n \"coordinate_system_orientation\": \"nozzle_to_combustion_chamber\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/motors/", + "host": [ + "{{endpoint}}" + ], + "path": [ + "motors", + "" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Read Motor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "", + "//TEST", + "bdd = \"Given a valid Motor GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " }); ", + " pm.test(bdd + \" then response must contain a valid motor\", function () {", + " pm.expect(apiRspn.burn_time).to.eql(pm.environment.get('burn_time'), \"motor burn_time not matching\");", + " pm.expect(apiRspn.dry_mass).to.eql(pm.environment.get('dry_mass'), \"motor dry_mass not matching\");", + " pm.expect(apiRspn.dry_inertia).to.eql(pm.environment.get('dry_inertia'), \"motor dry_inertia not matching\");", + " pm.expect(apiRspn.center_of_dry_mass_position).to.eql(pm.environment.get('center_of_dry_mass_position'), \"motor center_of_dry_mass_position not matching\");", + " pm.expect(apiRspn.grain_number).to.eql(pm.environment.get('grain_number'), \"motor grain_number not matching\");", + " pm.expect(apiRspn.grain_density).to.eql(pm.environment.get('grain_density'), \"motor grain_density not matching\");", + " pm.expect(apiRspn.grain_outer_radius).to.eql(pm.environment.get('grain_outer_radius'), \"motor grain_outer_radius not matching\");", + " pm.expect(apiRspn.grain_initial_inner_radius).to.eql(pm.environment.get('grain_initial_inner_radius'), \"motor grain_initial_inner_radius not matching\");", + " pm.expect(apiRspn.grain_initial_height).to.eql(pm.environment.get('grain_initial_height'), \"motor grain_initial_height not matching\");", + " pm.expect(apiRspn.grains_center_of_mass_position).to.eql(pm.environment.get('grains_center_of_mass_position'), \"motor grains_center_of_mass_position not matching\");", + " pm.expect(apiRspn.thrust_source).to.eql(pm.environment.get('thrust_source'), \"motor thrust_source not matching\");", + " pm.expect(apiRspn.grain_separation).to.eql(pm.environment.get('grain_separation'), \"motor grain_separation not matching\");", + " pm.expect(apiRspn.nozzle_radius).to.eql(pm.environment.get('nozzle_radius'), \"motor nozzle_radius not matching\");", + " pm.expect(apiRspn.throat_radius).to.eql(pm.environment.get('throat_radius'), \"motor throat_radius not matching\");", + " pm.expect(apiRspn.interpolation_method).to.eql(pm.environment.get('interpolation_method'), \"motor interpolation_method not matching\");", + " pm.expect(apiRspn.coordinate_system_orientation).to.eql(pm.environment.get('motor_coordinate_system_orientation'), \"motor coordinate_system_orientation not matching\");", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/motors/{{motor_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "motors", + "{{motor_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Read rocketpy Motor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "", + "//TEST", + "bdd = \"Given a valid rocketpy Motor GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.jsonpickle_rocketpy_motor).to.exist; ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/motors/rocketpy/{{motor_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "motors", + "rocketpy", + "{{motor_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Simulate Motor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "//TEST", + "bdd = \"Given a valid rocketpy Motor simulate GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.motor_data).to.exist;", + " pm.expect(apiRspn.motor_data.total_burning_time).to.exist;", + " pm.expect(apiRspn.motor_data.total_propellant_mass).to.exist;", + " pm.expect(apiRspn.motor_data.average_propellant_exhaust_velocity).to.exist;", + " pm.expect(apiRspn.motor_data.average_thrust).to.exist;", + " pm.expect(apiRspn.motor_data.maximum_thrust).to.exist;", + " pm.expect(apiRspn.motor_data.total_impulse).to.exist;", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/motors/{{motor_id}}/simulate", + "host": [ + "{{endpoint}}" + ], + "path": [ + "motors", + "{{motor_id}}", + "simulate" + ] + } + }, + "response": [] + }, + { + "name": "Update Motor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var motorRequest = JSON.parse(pm.request.body.raw);", + "", + "// save motor parameters", + "pm.environment.set('motor_id', apiRspn.new_motor_id)", + "pm.environment.set('burn_time', motorRequest.burn_time)", + "pm.environment.set('dry_mass', motorRequest.dry_mass)", + "pm.environment.set('dry_inertia', motorRequest.dry_inertia)", + "pm.environment.set('center_of_dry_mass_position', motorRequest.center_of_dry_mass_position)", + "pm.environment.set('grain_number', motorRequest.grain_number)", + "pm.environment.set('grain_density', motorRequest.grain_density)", + "pm.environment.set('grain_outer_radius', motorRequest.grain_outer_radius)", + "pm.environment.set('grain_initial_inner_radius', motorRequest.grain_initial_inner_radius)", + "pm.environment.set('grain_initial_height', motorRequest.grain_initial_height)", + "pm.environment.set('grains_center_of_mass_position', motorRequest.grains_center_of_mass_position)", + "pm.environment.set('grain_separation', motorRequest.grain_separation)", + "pm.environment.set('thrust_source', motorRequest.thrust_source)", + "pm.environment.set('nozzle_radius', motorRequest.nozzle_radius)", + "pm.environment.set('throat_radius', motorRequest.throat_radius)", + "pm.environment.set('interpolation_method', motorRequest.interpolation_method)", + "pm.environment.set('motor_coordinate_system_orientation', motorRequest.coordinate_system_orientation)", + "", + "//TEST", + "bdd = \"Given a valid Motor PUT request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Motor successfully updated\");", + " });", + " pm.test(bdd + \" then response must contain a valid new_motor_id\", function () {", + " pm.expect(apiRspn.new_motor_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"burn_time\": 3.9,\n \"dry_mass\": 1.815,\n \"dry_inertia\": [0.125, 0.125, 0.002],\n \"center_of_dry_mass_position\": 0.317,\n \"grain_number\": 5,\n \"grain_density\": 1815,\n \"grain_outer_radius\": 0.033,\n \"grain_initial_inner_radius\": 0.015,\n \"grain_initial_height\": 0.12,\n \"grains_center_of_mass_position\": -0.85704,\n \"grain_separation\": 0.005,\n \"thrust_source\": \"Cesaroni_M1670\", \n \"nozzle_radius\": 0.033,\n \"throat_radius\": 0.011,\n \"interpolation_method\": \"linear\",\n \"coordinate_system_orientation\": \"nozzle_to_combustion_chamber\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/motors/{{motor_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "motors", + "{{motor_id}}" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Delete Motor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "//TEST", + "bdd = \"Given a valid Motor DELETE request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Motor successfully deleted\", \"message not matching\");", + " pm.expect(apiRspn.deleted_motor_id).to.eql(pm.environment.get('motor_id'), \"motor_id not matching\"); ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{endpoint}}/motors/{{motor_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "motors", + "{{motor_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Rocket", + "item": [ + { + "name": "Create Rocket", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var rocketRequest = JSON.parse(pm.request.body.raw);", + "", + "// save rocket parameters", + "pm.environment.set('rocket_id', apiRspn.rocket_id)", + "pm.environment.set('radius', rocketRequest.radius)", + "pm.environment.set('mass', rocketRequest.mass)", + "pm.environment.set('inertia', rocketRequest.inertia)", + "pm.environment.set('power_off_drag', rocketRequest.power_off_drag)", + "pm.environment.set('power_on_drag', rocketRequest.power_on_drag)", + "pm.environment.set('center_of_mass_without_motor', rocketRequest.center_of_mass_without_motor)", + "pm.environment.set('motor_position', rocketRequest.motor_position)", + "pm.environment.set('rail_buttons', rocketRequest.rail_buttons)", + "pm.environment.set('upper_button_position', rocketRequest.rail_buttons.upper_button_position)", + "pm.environment.set('lower_button_position', rocketRequest.rail_buttons.lower_button_position)", + "pm.environment.set('angular_position', rocketRequest.rail_buttons.angular_position)", + "pm.environment.set('rocket_coordinate_system_orientation', rocketRequest.coordinate_system_orientation)", + "", + "// rocket motor", + "pm.environment.set('burn_time', rocketRequest.motor.burn_time)", + "pm.environment.set('dry_mass', rocketRequest.motor.dry_mass)", + "pm.environment.set('dry_inertia', rocketRequest.motor.dry_inertia)", + "pm.environment.set('center_of_dry_mass_position', rocketRequest.motor.center_of_dry_mass_position)", + "pm.environment.set('grain_number', rocketRequest.motor.grain_number)", + "pm.environment.set('grain_density', rocketRequest.motor.grain_density)", + "pm.environment.set('grain_outer_radius', rocketRequest.motor.grain_outer_radius)", + "pm.environment.set('grain_initial_inner_radius', rocketRequest.motor.grain_initial_inner_radius)", + "pm.environment.set('grain_initial_height', rocketRequest.motor.grain_initial_height)", + "pm.environment.set('grains_center_of_mass_position', rocketRequest.motor.grains_center_of_mass_position)", + "pm.environment.set('grain_separation', rocketRequest.motor.grain_separation)", + "pm.environment.set('thrust_source', rocketRequest.motor.thrust_source)", + "pm.environment.set('nozzle_radius', rocketRequest.motor.nozzle_radius)", + "pm.environment.set('throat_radius', rocketRequest.motor.throat_radius)", + "pm.environment.set('interpolation_method', rocketRequest.motor.interpolation_method)", + "pm.environment.set('motor_coordinate_system_orientation', rocketRequest.motor.coordinate_system_orientation)", + "", + "// rocket nose", + "pm.environment.set('nose_length', rocketRequest.nose.length)", + "pm.environment.set('kind', rocketRequest.nose.kind)", + "pm.environment.set('nose_position', rocketRequest.nose.position)", + "pm.environment.set('base_radius', rocketRequest.nose.base_radius)", + "pm.environment.set('rocket_radius', rocketRequest.nose.rocket_radius)", + "", + "// rocket fins", + "pm.environment.set('n', rocketRequest.fins.n)", + "pm.environment.set('root_chord', rocketRequest.fins.root_chord)", + "pm.environment.set('tip_chord', rocketRequest.fins.tip_chord)", + "pm.environment.set('span', rocketRequest.fins.span)", + "pm.environment.set('fin_position', rocketRequest.fins.position)", + "pm.environment.set('cant_angle', rocketRequest.fins.cant_angle)", + "pm.environment.set('fin_radius', rocketRequest.fins.radius)", + "pm.environment.set('airfoil', rocketRequest.fins.airfoil)", + "", + "// rocket tail", + "pm.environment.set('top_radius', rocketRequest.tail.top_radius)", + "pm.environment.set('bottom_radius', rocketRequest.tail.bottom_radius)", + "pm.environment.set('tail_length', rocketRequest.tail.length)", + "pm.environment.set('tail_position', rocketRequest.tail.position)", + "pm.environment.set('tail_radius', rocketRequest.tail.radius)", + "", + "// rocket parachute", + "pm.environment.set('parachutes_names', rocketRequest.parachutes.name)", + "pm.environment.set('parachutes_cds', rocketRequest.parachutes.cd_s)", + "pm.environment.set('parachutes_sampling_rate', rocketRequest.parachutes.sampling_rate)", + "pm.environment.set('parachutes_lags', rocketRequest.parachutes.lag)", + "pm.environment.set('parachutes_noises', rocketRequest.parachutes.noise)", + "pm.environment.set('parachutes_triggers', rocketRequest.parachutes.triggers)", + "", + "//TEST", + "bdd = \"Given a valid Rocket POST request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Rocket successfully created\");", + " });", + " pm.test(bdd + \" then response must contain a valid rocket_id\", function () {", + " pm.expect(apiRspn.rocket_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"radius\": 0.0632,\n \"mass\": 16.235,\n \"inertia\": [\n 6.321, \n 6.321, \n 0.0346\n ],\n \"power_off_drag\": \"calisto\",\n \"power_on_drag\": \"calisto\",\n \"center_of_mass_without_motor\": 0,\n \"coordinate_system_orientation\": \"tail_to_nose\",\n \"motor_position\": -1.255,\n \"rail_buttons\": {\n \"upper_button_position\": -0.5,\n \"lower_button_position\": 0.2,\n \"angular_position\": 45\n },\n \"motor\": {\n \"burn_time\": 3.9,\n \"dry_mass\": 1.815,\n \"dry_inertia\": [0.125, 0.125, 0.002],\n \"center_of_dry_mass_position\": 0.317,\n \"grain_number\": 5,\n \"grain_density\": 1815,\n \"grain_outer_radius\": 0.033,\n \"grain_initial_inner_radius\": 0.015,\n \"grain_initial_height\": 0.12,\n \"grains_center_of_mass_position\": -0.85704,\n \"grain_separation\": 0.005,\n \"thrust_source\": \"Cesaroni_M1670\", \n \"nozzle_radius\": 0.033,\n \"throat_radius\": 0.011,\n \"interpolation_method\": \"linear\",\n \"coordinate_system_orientation\": \"nozzle_to_combustion_chamber\"\n },\n \"nose\": {\n \"length\": 0.55829,\n \"kind\": \"vonKarman\",\n \"position\": 1.278,\n \"base_radius\": 0.0635,\n \"rocket_radius\": 0.0635\n },\n \"fins\": {\n \"n\": 4,\n \"root_chord\": 0.12,\n \"tip_chord\": 0.04,\n \"span\": 0.1,\n \"position\": -1.04956,\n \"cant_angle\": 0,\n \"radius\": 0.0635,\n \"airfoil\": \"\"\n },\n \"tail\": {\n \"top_radius\": 0.0635,\n \"bottom_radius\": 0.0435,\n \"length\": 0.06,\n \"position\": -1.194656,\n \"radius\": 0.0635\n },\n \"parachutes\": {\n \"name\": [\n \"Main\",\n \"Drogue\"\n ],\n \"cd_s\": [\n 10,\n 1\n ],\n \"sampling_rate\": [\n 105,\n 105\n ],\n \"lag\": [\n 1.5,\n 1.5\n ],\n \"noise\": [\n [\n 0,\n 8.3,\n 0.5\n ],\n [\n 0,\n 8.3,\n 0.5\n ]\n ],\n \"triggers\": [\n \"lambda p, h, y: y[5] < 0 and h < 800\",\n \"lambda p, h, y: y[5] < 0\"\n ]\n } \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/rockets/", + "host": [ + "{{endpoint}}" + ], + "path": [ + "rockets", + "" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Read Rocket", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "", + "//TEST", + "bdd = \"Given a valid Rocket GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " }); ", + " pm.test(bdd + \" then response must contain a valid rocket\", function () { ", + " pm.expect(apiRspn.radius).to.eql(pm.environment.get('radius'), \"rocket radius not matching\");", + " pm.expect(apiRspn.mass).to.eql(pm.environment.get('mass'), \"rocket mass not matching\");", + " pm.expect(apiRspn.inertia).to.eql(pm.environment.get('inertia'), \"rocket inertia not matching\");", + " pm.expect(apiRspn.power_off_drag).to.eql(pm.environment.get('power_off_drag'), \"rocket power_off_drag not matching\");", + " pm.expect(apiRspn.power_on_drag).to.eql(pm.environment.get('power_on_drag'), \"rocket power_on_drag not matching\");", + " pm.expect(apiRspn.center_of_mass_without_motor).to.eql(pm.environment.get('center_of_mass_without_motor'), \"rocket center_of_mass_without_motor not matching\");", + " pm.expect(apiRspn.coordinate_system_orientation).to.eql(pm.environment.get('rocket_coordinate_system_orientation'), \"rocket coordinate_system_orientation not matching\");", + " pm.expect(apiRspn.motor_position).to.eql(pm.environment.get('motor_position'), \"rocket motor_position not matching\");", + " pm.expect(apiRspn.rail_buttons).to.eql(pm.environment.get('rail_buttons'), \"rocket rail_buttons not matching\");", + " pm.expect(apiRspn.rail_buttons.upper_button_position).to.eql(pm.environment.get('upper_button_position'), \"rocket rail_buttons upper_button_position not matching\");", + " pm.expect(apiRspn.rail_buttons.lower_button_position).to.eql(pm.environment.get('lower_button_position'), \"rocket rail_buttons lower_button_position not matching\");", + " pm.expect(apiRspn.rail_buttons.angular_position).to.eql(pm.environment.get('angular_position'), \"rocket rail_buttons angular_position not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket motor\", function () {", + " pm.expect(apiRspn.motor.burn_time).to.eql(pm.environment.get('burn_time'), \"rocket motor burn_time not matching\");", + " pm.expect(apiRspn.motor.dry_mass).to.eql(pm.environment.get('dry_mass'), \"rocket motor dry_mass not matching\");", + " pm.expect(apiRspn.motor.dry_inertia).to.eql(pm.environment.get('dry_inertia'), \"rocket motor dry_inertia not matching\");", + " pm.expect(apiRspn.motor.center_of_dry_mass_position).to.eql(pm.environment.get('center_of_dry_mass_position'), \"rocket motor center_of_dry_mass_position not matching\");", + " pm.expect(apiRspn.motor.grain_number).to.eql(pm.environment.get('grain_number'), \"rocket motor grain_number not matching\");", + " pm.expect(apiRspn.motor.grain_density).to.eql(pm.environment.get('grain_density'), \"rocket motor grain_density not matching\");", + " pm.expect(apiRspn.motor.grain_outer_radius).to.eql(pm.environment.get('grain_outer_radius'), \"rocket motor grain_outer_radius not matching\");", + " pm.expect(apiRspn.motor.grain_initial_inner_radius).to.eql(pm.environment.get('grain_initial_inner_radius'), \"rocket motor grain_initial_inner_radius not matching\");", + " pm.expect(apiRspn.motor.grain_initial_height).to.eql(pm.environment.get('grain_initial_height'), \"rocket motor grain_initial_height not matching\");", + " pm.expect(apiRspn.motor.grains_center_of_mass_position).to.eql(pm.environment.get('grains_center_of_mass_position'), \"rocket motor grains_center_of_mass_position not matching\");", + " pm.expect(apiRspn.motor.thrust_source).to.eql(pm.environment.get('thrust_source'), \"rocket motor thrust_source not matching\");", + " pm.expect(apiRspn.motor.grain_separation).to.eql(pm.environment.get('grain_separation'), \"rocket motor grain_separation not matching\");", + " pm.expect(apiRspn.motor.nozzle_radius).to.eql(pm.environment.get('nozzle_radius'), \"rocket motor nozzle_radius not matching\");", + " pm.expect(apiRspn.motor.throat_radius).to.eql(pm.environment.get('throat_radius'), \"rocket motor throat_radius not matching\");", + " pm.expect(apiRspn.motor.interpolation_method).to.eql(pm.environment.get('interpolation_method'), \"rocket motor interpolation_method not matching\");", + " pm.expect(apiRspn.motor.coordinate_system_orientation).to.eql(pm.environment.get('motor_coordinate_system_orientation'), \"motor coordinate_system_orientation not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket nose\", function () {", + " pm.expect(apiRspn.nose.length).to.eql(pm.environment.get('nose_length'), \"rocket nose length not matching\");", + " pm.expect(apiRspn.nose.kind).to.eql(pm.environment.get('kind'), \"rocket nose kind not matching\");", + " pm.expect(apiRspn.nose.position).to.eql(pm.environment.get('nose_position'), \"rocket nose position not matching\");", + " pm.expect(apiRspn.nose.base_radius).to.eql(pm.environment.get('base_radius'), \"rocket nose base_radius not matching\");", + " pm.expect(apiRspn.nose.rocket_radius).to.eql(pm.environment.get('rocket_radius'), \"rocket nose rocket_radius not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket fins\", function () {", + " pm.expect(apiRspn.fins.n).to.eql(pm.environment.get('n'), \"rocket fins 'n' not matching\");", + " pm.expect(apiRspn.fins.root_chord).to.eql(pm.environment.get('root_chord'), \"rocket fins root_chord not matching\");", + " pm.expect(apiRspn.fins.tip_chord).to.eql(pm.environment.get('tip_chord'), \"rocket fins tip_chord not matching\");", + " pm.expect(apiRspn.fins.span).to.eql(pm.environment.get('span'), \"rocket fins span not matching\");", + " pm.expect(apiRspn.fins.position).to.eql(pm.environment.get('fin_position'), \"rocket fins position not matching\");", + " pm.expect(apiRspn.fins.cant_angle).to.eql(pm.environment.get('cant_angle'), \"rocket fins cant_angle not matching\");", + " pm.expect(apiRspn.fins.radius).to.eql(pm.environment.get('fin_radius'), \"rocket fins radius not matching\");", + " pm.expect(apiRspn.fins.airfoil).to.eql(pm.environment.get('airfoil'), \"rocket fins airfoil not matching\");", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket tail\", function () {", + " pm.expect(apiRspn.tail.top_radius).to.eql(pm.environment.get('top_radius'), \"rocket tail top_radius not matching\"); ", + " pm.expect(apiRspn.tail.bottom_radius).to.eql(pm.environment.get('bottom_radius'), \"rocket tail bottom_radius not matching\"); ", + " pm.expect(apiRspn.tail.length).to.eql(pm.environment.get('tail_length'), \"rocket tail length not matching\"); ", + " pm.expect(apiRspn.tail.position).to.eql(pm.environment.get('tail_position'), \"rocket tail position not matching\"); ", + " pm.expect(apiRspn.tail.radius).to.eql(pm.environment.get('tail_radius'), \"rocket tail radius not matching\"); ", + " });", + " pm.test(bdd + \" then response must contain a valid flight rocket parachutes\", function () {", + " pm.expect(apiRspn.parachutes.name).to.eql(pm.environment.get('parachutes_names'), \"rocket parachutes names not matching\"); ", + " pm.expect(apiRspn.parachutes.cd_s).to.eql(pm.environment.get('parachutes_cds'), \"rocket parachutes cd_s not matching\"); ", + " pm.expect(apiRspn.parachutes.sampling_rate).to.eql(pm.environment.get('parachutes_sampling_rate'), \"rocket parachutes sampling_rate not matching\"); ", + " pm.expect(apiRspn.parachutes.lag).to.eql(pm.environment.get('parachutes_lags'), \"rocket parachutes lags not matching\"); ", + " pm.expect(apiRspn.parachutes.noise).to.eql(pm.environment.get('parachutes_noises'), \"rocket parachutes noises not matching\");", + " pm.expect(apiRspn.parachutes.triggers).to.eql(pm.environment.get('parachutes_triggers'), \"rocket parachutes triggers not matching\");", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/rockets/{{rocket_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "rockets", + "{{rocket_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Read rocketpy Rocket", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "", + "//TEST", + "bdd = \"Given a valid rocketpy Rocket GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.jsonpickle_rocketpy_rocket).to.exist; ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/rockets/rocketpy/{{rocket_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "rockets", + "rocketpy", + "{{rocket_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Simulate Rocket", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "//TEST", + "bdd = \"Given a valid rocketpy Rocket simulate GET request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.rocket_data).to.exist;", + " pm.expect(apiRspn.rocket_data.inertia_details).to.exist;", + " pm.expect(apiRspn.rocket_data.inertia_details.rocket_mass_without_propellant).to.exist;", + " pm.expect(apiRspn.rocket_data.inertia_details.rocket_mass_with_propellant).to.exist;", + " pm.expect(apiRspn.rocket_data.inertia_details.rocket_inertia_with_motor_without_propellant).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_geometrical_parameters).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_geometrical_parameters.rocket_maximum_radius).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_geometrical_parameters.rocket_frontal_area).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_geometrical_parameters.rocket_codm_nozzle_exit_distance).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_geometrical_parameters.rocket_codm_center_of_propellant_mass).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_geometrical_parameters.rocket_codm_loaded_center_of_mass).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_aerodynamics_quantities).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_aerodynamics_quantities.aerodynamics_lift_coefficient_derivatives).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_aerodynamics_quantities.aerodynamics_center_of_pressure).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_aerodynamics_quantities.distance_cop_to_codm).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_aerodynamics_quantities.initial_static_margin).to.exist;", + " pm.expect(apiRspn.rocket_data.rocket_aerodynamics_quantities.final_static_margin).to.exist;", + " pm.expect(apiRspn.rocket_data.parachute_data).to.exist;", + " pm.expect(apiRspn.rocket_data.parachute_data.parachute_details).to.exist;", + " pm.expect(apiRspn.rocket_data.parachute_data.parachute_ejection_system_refresh_rate).to.exist;", + " pm.expect(apiRspn.rocket_data.parachute_data.parachute_lag).to.exist;", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/rockets/{{rocket_id}}/simulate", + "host": [ + "{{endpoint}}" + ], + "path": [ + "rockets", + "{{rocket_id}}", + "simulate" + ] + } + }, + "response": [] + }, + { + "name": "Update Rocket", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "var rocketRequest = JSON.parse(pm.request.body.raw);", + "", + "// save rocket parameters", + "pm.environment.set('rocket_id', apiRspn.new_rocket_id)", + "pm.environment.set('radius', rocketRequest.radius)", + "pm.environment.set('mass', rocketRequest.mass)", + "pm.environment.set('inertia', rocketRequest.inertia)", + "pm.environment.set('power_off_drag', rocketRequest.power_off_drag)", + "pm.environment.set('power_on_drag', rocketRequest.power_on_drag)", + "pm.environment.set('center_of_mass_without_motor', rocketRequest.center_of_mass_without_motor)", + "pm.environment.set('motor_position', rocketRequest.motor_position)", + "pm.environment.set('rail_buttons', rocketRequest.rail_buttons)", + "pm.environment.set('upper_button_position', rocketRequest.rail_buttons.upper_button_position)", + "pm.environment.set('lower_button_position', rocketRequest.rail_buttons.lower_button_position)", + "pm.environment.set('angular_position', rocketRequest.rail_buttons.angular_position)", + "pm.environment.set('rocket_coordinate_system_orientation', rocketRequest.coordinate_system_orientation)", + "", + "// rocket motor", + "pm.environment.set('burn_time', rocketRequest.motor.burn_time)", + "pm.environment.set('dry_mass', rocketRequest.motor.dry_mass)", + "pm.environment.set('dry_inertia', rocketRequest.motor.dry_inertia)", + "pm.environment.set('center_of_dry_mass_position', rocketRequest.motor.center_of_dry_mass_position)", + "pm.environment.set('grain_number', rocketRequest.motor.grain_number)", + "pm.environment.set('grain_density', rocketRequest.motor.grain_density)", + "pm.environment.set('grain_outer_radius', rocketRequest.motor.grain_outer_radius)", + "pm.environment.set('grain_initial_inner_radius', rocketRequest.motor.grain_initial_inner_radius)", + "pm.environment.set('grain_initial_height', rocketRequest.motor.grain_initial_height)", + "pm.environment.set('grains_center_of_mass_position', rocketRequest.motor.grains_center_of_mass_position)", + "pm.environment.set('grain_separation', rocketRequest.motor.grain_separation)", + "pm.environment.set('thrust_source', rocketRequest.motor.thrust_source)", + "pm.environment.set('nozzle_radius', rocketRequest.motor.nozzle_radius)", + "pm.environment.set('throat_radius', rocketRequest.motor.throat_radius)", + "pm.environment.set('interpolation_method', rocketRequest.motor.interpolation_method)", + "pm.environment.set('motor_coordinate_system_orientation', rocketRequest.motor.coordinate_system_orientation)", + "", + "// rocket nose", + "pm.environment.set('nose_length', rocketRequest.nose.length)", + "pm.environment.set('kind', rocketRequest.nose.kind)", + "pm.environment.set('nose_position', rocketRequest.nose.position)", + "pm.environment.set('base_radius', rocketRequest.nose.base_radius)", + "pm.environment.set('rocket_radius', rocketRequest.nose.rocket_radius)", + "", + "// rocket fins", + "pm.environment.set('n', rocketRequest.fins.n)", + "pm.environment.set('root_chord', rocketRequest.fins.root_chord)", + "pm.environment.set('tip_chord', rocketRequest.fins.tip_chord)", + "pm.environment.set('span', rocketRequest.fins.span)", + "pm.environment.set('fin_position', rocketRequest.fins.position)", + "pm.environment.set('cant_angle', rocketRequest.fins.cant_angle)", + "pm.environment.set('fin_radius', rocketRequest.fins.radius)", + "pm.environment.set('airfoil', rocketRequest.fins.airfoil)", + "", + "// rocket tail", + "pm.environment.set('top_radius', rocketRequest.tail.top_radius)", + "pm.environment.set('bottom_radius', rocketRequest.tail.bottom_radius)", + "pm.environment.set('tail_length', rocketRequest.tail.length)", + "pm.environment.set('tail_position', rocketRequest.tail.position)", + "pm.environment.set('tail_radius', rocketRequest.tail.radius)", + "", + "// rocket parachute", + "pm.environment.set('parachutes_names', rocketRequest.parachutes.name)", + "pm.environment.set('parachutes_cds', rocketRequest.parachutes.cd_s)", + "pm.environment.set('parachutes_sampling_rate', rocketRequest.parachutes.sampling_rate)", + "pm.environment.set('parachutes_lags', rocketRequest.parachutes.lag)", + "pm.environment.set('parachutes_noises', rocketRequest.parachutes.noise)", + "pm.environment.set('parachutes_triggers', rocketRequest.parachutes.triggers)", + "", + "//TEST", + "bdd = \"Given a valid Rocket PUT request is made to the API\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Rocket successfully updated\");", + " });", + " pm.test(bdd + \" then response must contain a valid rocket_id\", function () {", + " pm.expect(apiRspn.new_rocket_id).to.exist; ", + " });" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"radius\": 0.0632,\n \"mass\": 16.235,\n \"inertia\": [\n 6.321, \n 6.321, \n 0.0346\n ],\n \"power_off_drag\": \"calisto\",\n \"power_on_drag\": \"calisto\",\n \"center_of_mass_without_motor\": 0,\n \"coordinate_system_orientation\": \"tail_to_nose\",\n \"motor_position\": -1.255,\n \"rail_buttons\": {\n \"upper_button_position\": -0.5,\n \"lower_button_position\": 0.2,\n \"angular_position\": 45\n },\n \"motor\": {\n \"burn_time\": 3.9,\n \"dry_mass\": 1.815,\n \"dry_inertia\": [0.125, 0.125, 0.002],\n \"center_of_dry_mass_position\": 0.317,\n \"grain_number\": 5,\n \"grain_density\": 1815,\n \"grain_outer_radius\": 0.033,\n \"grain_initial_inner_radius\": 0.015,\n \"grain_initial_height\": 0.12,\n \"grains_center_of_mass_position\": -0.85704,\n \"grain_separation\": 0.005,\n \"thrust_source\": \"Cesaroni_M1670\", \n \"nozzle_radius\": 0.033,\n \"throat_radius\": 0.011,\n \"interpolation_method\": \"linear\",\n \"coordinate_system_orientation\": \"nozzle_to_combustion_chamber\"\n },\n \"nose\": {\n \"length\": 0.55829,\n \"kind\": \"vonKarman\",\n \"position\": 1.278,\n \"base_radius\": 0.0635,\n \"rocket_radius\": 0.0635\n },\n \"fins\": {\n \"n\": 4,\n \"root_chord\": 0.12,\n \"tip_chord\": 0.04,\n \"span\": 0.1,\n \"position\": -1.04956,\n \"cant_angle\": 0,\n \"radius\": 0.0635,\n \"airfoil\": \"\"\n },\n \"tail\": {\n \"top_radius\": 0.0635,\n \"bottom_radius\": 0.0435,\n \"length\": 0.06,\n \"position\": -1.194656,\n \"radius\": 0.0635\n },\n \"parachutes\": {\n \"name\": [\n \"Main\",\n \"Drogue\"\n ],\n \"cd_s\": [\n 10,\n 1\n ],\n \"sampling_rate\": [\n 105,\n 105\n ],\n \"lag\": [\n 1.5,\n 1.5\n ],\n \"noise\": [\n [\n 0,\n 8.3,\n 0.5\n ],\n [\n 0,\n 8.3,\n 0.5\n ]\n ],\n \"triggers\": [\n \"lambda p, h, y: y[5] < 0 and h < 800\",\n \"lambda p, h, y: y[5] < 0\"\n ]\n } \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{endpoint}}/rockets/{{rocket_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "rockets", + "{{rocket_id}}" + ] + }, + "description": "This returns a `token` that you can use to retrieve information later on.\n\nWe have included a test to confirm if a token is returned. We have also added test scripts to copy the token to the `token` collection variable. This makes it easy for us to reuse this token in other requests in the collection." + }, + "response": [] + }, + { + "name": "Delete Rocket", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "//Fixes the issue of breaking the collection runner whenever an http 500 is received", + "if (responseCode.code == 500) {", + " pm.test(\"Given a request is made then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " return", + "}", + "", + "var apiRspn = pm.response.json();", + "//TEST", + "bdd = \"Given a valid Rocket DELETE request is made\";", + " pm.test(bdd + \" then response must return a 200 status code\", function () {", + " pm.expect(responseCode.code).to.eql(200);", + " });", + " pm.test(bdd + \" then response must contain a valid message\", function () {", + " pm.expect(apiRspn.message).to.eql(\"Rocket successfully deleted\", \"message not matching\");", + " pm.expect(apiRspn.deleted_rocket_id).to.eql(pm.environment.get('rocket_id'), \"rocket_id not matching\"); ", + " });" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{endpoint}}/rockets/{{rocket_id}}", + "host": [ + "{{endpoint}}" + ], + "path": [ + "rockets", + "{{rocket_id}}" + ] + } + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "env_id", + "value": "" + }, + { + "key": "latitude", + "value": "" + }, + { + "key": "longitude", + "value": "" + }, + { + "key": "elevation", + "value": "" + }, + { + "key": "standard_atmosphere", + "value": "" + }, + { + "key": "atmospheric_model_type", + "value": "" + }, + { + "key": "atmospheric_model_file", + "value": "" + }, + { + "key": "date", + "value": "" + }, + { + "key": "rail_length", + "value": "" + }, + { + "key": "inclination", + "value": "" + }, + { + "key": "heading", + "value": "" + }, + { + "key": "flight_id", + "value": "" + }, + { + "key": "radius", + "value": "" + }, + { + "key": "mass", + "value": "" + }, + { + "key": "inertia", + "value": "" + }, + { + "key": "power_off_drag", + "value": "" + }, + { + "key": "power_on_drag", + "value": "" + }, + { + "key": "center_of_mass_without_motor", + "value": "" + }, + { + "key": "motor_position", + "value": "" + }, + { + "key": "rail_buttons", + "value": "" + }, + { + "key": "upper_button_position", + "value": "" + }, + { + "key": "lower_button_position", + "value": "" + }, + { + "key": "angular_position", + "value": "" + }, + { + "key": "burn_time", + "value": "" + }, + { + "key": "dry_mass", + "value": "" + }, + { + "key": "dry_inertia", + "value": "" + }, + { + "key": "center_of_dry_mass_position", + "value": "" + }, + { + "key": "grain_number", + "value": "" + }, + { + "key": "grain_density", + "value": "" + }, + { + "key": "grain_outer_radius", + "value": "" + }, + { + "key": "grain_initial_inner_radius", + "value": "" + }, + { + "key": "grain_initial_height", + "value": "" + }, + { + "key": "grains_center_of_mass_position", + "value": "" + }, + { + "key": "grain_separation", + "value": "" + }, + { + "key": "thrust_source", + "value": "" + }, + { + "key": "nozzle_radius", + "value": "" + }, + { + "key": "throat_radius", + "value": "" + }, + { + "key": "interpolation_method", + "value": "" + }, + { + "key": "coordinate_system_orientation", + "value": "" + }, + { + "key": "length", + "value": "" + }, + { + "key": "kind", + "value": "" + }, + { + "key": "position", + "value": "" + }, + { + "key": "base_radius", + "value": "" + }, + { + "key": "rocket_radius", + "value": "" + }, + { + "key": "n", + "value": "" + }, + { + "key": "root_chord", + "value": "" + }, + { + "key": "tip_chord", + "value": "" + }, + { + "key": "span", + "value": "" + }, + { + "key": "cant_angle", + "value": "" + }, + { + "key": "airfoil", + "value": "" + }, + { + "key": "top_radius", + "value": "" + }, + { + "key": "bottom_radius", + "value": "" + }, + { + "key": "parachutes_names", + "value": "" + }, + { + "key": "parachutes_cds", + "value": "" + }, + { + "key": "parachutes_sampling_rate", + "value": "" + }, + { + "key": "parachutes_lags", + "value": "" + }, + { + "key": "parachutes_noises", + "value": "" + }, + { + "key": "parachutes_triggers", + "value": "" + }, + { + "key": "nose_length", + "value": "" + }, + { + "key": "nose_position", + "value": "" + }, + { + "key": "fin_position", + "value": "" + }, + { + "key": "fin_radius", + "value": "" + }, + { + "key": "tail_length", + "value": "" + }, + { + "key": "tail_position", + "value": "" + }, + { + "key": "tail_radius", + "value": "" + }, + { + "key": "rocket_coordinate_system_orientation", + "value": "" + }, + { + "key": "motor_coordinate_system_orientation", + "value": "" + }, + { + "key": "motor_id", + "value": "" + }, + { + "key": "rocket_id", + "value": "" + } + ] +} \ No newline at end of file From 307d81a0e129722790f41bc96579d22e1ca56f83 Mon Sep 17 00:00:00 2001 From: GabrielBarberini Date: Mon, 2 Oct 2023 11:47:01 -0300 Subject: [PATCH 2/2] removes rail_length --- lib/models/environment.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/models/environment.py b/lib/models/environment.py index 8374cf7..ee86ece 100644 --- a/lib/models/environment.py +++ b/lib/models/environment.py @@ -5,7 +5,6 @@ class Env(BaseModel, frozen=True): latitude: float = 0 longitude: float = 0 - rail_length: Optional[float] = 5.2 elevation: Optional[int] = 1400 atmospheric_model_type: Optional[str] = 'standard_atmosphere' atmospheric_model_file: Optional[str] = 'GFS'