Skip to content

Commit 2970916

Browse files
authored
Merge pull request #16 from leogregianin/httpbin-patch-1
added patch method, images routes and reorganize files
2 parents 3ba313b + 38b3b78 commit 2970916

File tree

4 files changed

+1855
-232
lines changed

4 files changed

+1855
-232
lines changed

httpbin-api/http-methods.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
- name: get-simple
2+
path: /get
3+
method: get
4+
5+
- name: post-simple
6+
path: /post
7+
method: post
8+
vars:
9+
scanapi_var: scanapi_test1
10+
body:
11+
description: hello scanapi
12+
scanapi_test: ${scanapi_var}
13+
tests:
14+
- name: status_code_is_200
15+
assert: ${{ response.status_code == 200 }}
16+
- name: body_is_ok
17+
assert: ${{ response.json()["json"].get("scanapi_test") == "${scanapi_var}" }}
18+
- name: response_origin
19+
assert: ${{ response.json()["origin"] is not None }}
20+
21+
- name: put-simple
22+
path: /put
23+
method: put
24+
vars:
25+
scanapi_description: hello scanapi again
26+
body:
27+
description: ${scanapi_description}
28+
tests:
29+
- name: status_code_is_200
30+
assert: ${{ response.status_code == 200 }}
31+
- name: description_changed
32+
assert: ${{ response.json()["json"].get("description") == "${scanapi_description}" }}
33+
34+
- name: patch-simple
35+
path: /patch
36+
method: patch
37+
vars:
38+
scanapi_description: hello scanapi patch method
39+
body:
40+
description: ${scanapi_description}
41+
tests:
42+
- name: status_code_is_200
43+
assert: ${{ response.status_code == 200 }}
44+
- name: description_changed
45+
assert: ${{ response.json()["json"].get("description") == "${scanapi_description}" }}
46+
47+
- name: delete-simple
48+
path: /delete
49+
method: delete
50+
tests:
51+
- name: status_code_is_200
52+
assert: ${{ response.status_code == 200 }}

httpbin-api/httpbin.yaml

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,11 @@ endpoints:
33
path: https://httpbin.org
44
headers:
55
Accept: application/json
6-
requests:
7-
- name: get-simple
8-
path: /get
9-
method: get
10-
11-
- name: get-image
12-
path: /image/png
13-
headers:
14-
Accept: image/png
15-
method: get
16-
tests:
17-
- name: status_code_is_200
18-
assert: ${{ response.status_code == 200 }}
19-
- name: content_type_is_png
20-
assert: ${{ response.headers.get("content-type") == "image/png" }}
21-
22-
- name: post-simple
23-
path: /post
24-
method: post
25-
vars:
26-
scanapi_var: scanapi_test1
27-
body:
28-
description: hello scanapi
29-
scanapi_test: ${scanapi_var}
30-
tests:
31-
- name: status_code_is_200
32-
assert: ${{ response.status_code == 200 }}
33-
- name: body_is_ok
34-
assert: ${{ response.json()["json"].get("scanapi_test") == "${scanapi_var}" }}
35-
- name: response_origin
36-
assert: ${{ response.json()["origin"] is not None }}
37-
38-
- name: put-simple
39-
path: /put
40-
method: put
41-
vars:
42-
scanapi_description: hello scanapi again
43-
body:
44-
description: ${scanapi_description}
45-
tests:
46-
- name: status_code_is_200
47-
assert: ${{ response.status_code == 200 }}
48-
- name: description_changed
49-
assert: ${{ response.json()["json"].get("description") == "${scanapi_description}" }}
50-
51-
- name: delete-simple
52-
path: /delete
53-
method: delete
54-
tests:
55-
- name: status_code_is_200
56-
assert: ${{ response.status_code == 200 }}
6+
endpoints:
7+
- name: http-methods
8+
requests:
9+
!include http-methods.yaml
10+
11+
- name: images
12+
requests:
13+
!include images.yaml

httpbin-api/images.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
- name: image-png
2+
path: /image/png
3+
headers:
4+
Accept: image/png
5+
method: get
6+
tests:
7+
- name: status_code_is_200
8+
assert: ${{ response.status_code == 200 }}
9+
10+
- name: content_type_is_png
11+
assert: ${{ response.headers.get("content-type") == "image/png" }}
12+
13+
- name: image-jpeg
14+
path: /image/jpeg
15+
headers:
16+
Accept: image/jpeg
17+
method: get
18+
tests:
19+
- name: status_code_is_200
20+
assert: ${{ response.status_code == 200 }}
21+
22+
- name: content_type_is_jpeg
23+
assert: ${{ response.headers.get("content-type") == "image/jpeg" }}
24+
25+
- name: image-svg
26+
path: /image/svg
27+
headers:
28+
Accept: image/svg+xml
29+
method: get
30+
tests:
31+
- name: status_code_is_200
32+
assert: ${{ response.status_code == 200 }}
33+
34+
- name: content_type_is_svg
35+
assert: ${{ response.headers.get("content-type") == "image/svg+xml" }}
36+
37+
- name: image-webp
38+
path: /image/webp
39+
headers:
40+
Accept: image/webp
41+
method: get
42+
tests:
43+
- name: status_code_is_200
44+
assert: ${{ response.status_code == 200 }}
45+
46+
- name: content_type_is_webp
47+
assert: ${{ response.headers.get("content-type") == "image/webp" }}

0 commit comments

Comments
 (0)