Tests: error report corrected for unknown variables in "response_headers"

For more information please see https://github.com/nginx/unit/pull/1191
This commit is contained in:
Andrei Zeliankou 2024-04-04 12:11:13 +01:00 committed by andrey-zelenkov
parent 2d7a846843
commit 626977730f

View file

@ -163,12 +163,11 @@ def test_response_headers_remove():
def test_response_headers_invalid(skip_alert):
skip_alert(r'failed to apply new conf')
def check_invalid(conf):
assert 'error' in client.conf(
conf,
'routes/0/action/response_headers',
)
resp = client.conf(conf, 'routes/0/action/response_headers')
assert 'error' in resp
check_invalid({"X-Foo": "$u"})
return resp
resp = check_invalid({"X-Foo": "$u"})
assert 'detail' in resp and 'Unknown variable' in resp['detail']