diff --git a/functions/hello/tests.yml b/functions/hello/tests.yml new file mode 100644 index 0000000..6ac5662 --- /dev/null +++ b/functions/hello/tests.yml @@ -0,0 +1,19 @@ +tests: + - handler: hello + cases: + - name: valid_name + input: + body: + name: "Foundry" + expect: + status: 200 + body: + greeting: "Hello Foundry! It is nice to see you." + + - name: missing_name + input: + body: {} + expect: + status: 400 + errors: + - "missing name from request body" diff --git a/functions/host-details/tests.yml b/functions/host-details/tests.yml new file mode 100644 index 0000000..ac08f91 --- /dev/null +++ b/functions/host-details/tests.yml @@ -0,0 +1,24 @@ +tests: + - handler: host-details + cases: + - name: valid_host_id + input: + body: + host_id: "YOUR_HOST_AID_HERE" + expect: + status: 200 + + - name: missing_host_id + input: + body: {} + expect: + status: 400 + errors: + - "missing host_id from request body" + + - name: invalid_host_id + input: + body: + host_id: "does_not_exist" + expect: + status: 404