Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gnufede committed Jan 10, 2025
1 parent 143a7b6 commit a9cd9fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/contrib/flask/test_flask_appsec_iast.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ def sqli_1(param_str):
_deduplication_enabled=False,
)
):
resp = self.client.post("/sqli/sqlite_master/", data={"name": "test"})
resp = self.client.post("/sqli/test/", data={"name": "sqlite_master"})
assert resp.status_code == 200

root_span = self.pop_spans()[0]
assert root_span.get_metric(IAST.ENABLED) == 1.0

loaded = json.loads(root_span.get_tag(IAST.JSON))
assert loaded["sources"] == [
{"origin": "http.request.path.parameter.name", "name": "name", "value": "test"}
{"origin": "http.request.path.parameter.name", "name": "name", "value": "sqlite_master"}
]

line, hash_value = get_line_and_hash(
Expand All @@ -152,7 +152,7 @@ def sqli_1(param_str):
{"value": "SELECT "},
{"redacted": True},
{"value": " FROM "},
{"value": "test", "source": 0},
{"value": "sqlite_master", "source": 0},
]
}
assert vulnerability["location"]["line"] == line
Expand Down Expand Up @@ -186,15 +186,15 @@ def sqli_1(param_str):
_deduplication_enabled=False,
)
):
resp = self.client.get("/sqli/sqlite_master/", params={"name": "test"})
resp = self.client.get("/sqli/test/", params={"name": "sqlite_master"})
assert resp.status_code == 200

root_span = self.pop_spans()[0]
assert root_span.get_metric(IAST.ENABLED) == 1.0

loaded = json.loads(root_span.get_tag(IAST.JSON))
assert loaded["sources"] == [
{"origin": "http.request.path.parameter.name", "name": "name", "value": "test"}
{"origin": "http.request.path.parameter.name", "name": "name", "value": "sqlite_master"}
]

line, hash_value = get_line_and_hash(
Expand All @@ -209,7 +209,7 @@ def sqli_1(param_str):
{"value": "SELECT "},
{"redacted": True},
{"value": " FROM "},
{"value": "test", "source": 0},
{"value": "sqlite_master", "source": 0},
]
}
assert vulnerability["location"]["line"] == line
Expand Down

0 comments on commit a9cd9fc

Please sign in to comment.