File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 33
33
working-directory : ./sample-apps/flask-postgres
34
34
run : |
35
35
docker compose -f docker-compose.yml -f docker-compose.benchmark.yml up --build -d
36
+ - name : Start flask-postgres-xml
37
+ working-directory : ./sample-apps/flask-postgres-xml
38
+ run : |
39
+ docker compose -f docker-compose.yml -f docker-compose.benchmark.yml up --build -d
36
40
37
41
- name : Set up Python ${{ matrix.python-version }}
38
42
uses : actions/setup-python@v2
Original file line number Diff line number Diff line change
1
+ import pytest
2
+ import requests
3
+ # e2e tests for flask_postgres sample app
4
+ post_url_fw = "http://localhost:8092/xml_post"
5
+ post_url_nofw = "http://localhost:8093/xml_post"
6
+
7
+ def test_safe_response_with_firewall ():
8
+ xml_data = '<dogs><dog dog_name="Bobby" /></dogs>'
9
+ res = requests .post (post_url_fw , data = xml_data )
10
+ assert res .status_code == 200
11
+
12
+
13
+ def test_safe_response_without_firewall ():
14
+ xml_data = '<dogs><dog dog_name="Bobby" /></dogs>'
15
+ res = requests .post (post_url_nofw , data = xml_data )
16
+ assert res .status_code == 200
17
+
18
+
19
+ def test_dangerous_response_with_firewall ():
20
+ xml_data = '<dogs><dog dog_name="Malicious dog\' , TRUE); -- " /></dogs>'
21
+ res = requests .post (post_url_fw , data = xml_data )
22
+ assert res .status_code == 500
23
+
24
+ def test_dangerous_response_without_firewall ():
25
+ xml_data = '<dogs><dog dog_name="Malicious dog\' , TRUE); -- " /></dogs>'
26
+ res = requests .post (post_url_nofw , data = xml_data )
27
+ assert res .status_code == 200
28
+
You can’t perform that action at this time.
0 commit comments