mirror of
https://github.com/ai-robots-txt/ai.robots.txt.git
synced 2026-06-04 08:06:55 +02:00
tests: make nginx bypass assertion explicit
This commit is contained in:
parent
507d16262a
commit
dc0e28989b
1 changed files with 3 additions and 3 deletions
|
|
@ -26,9 +26,9 @@ def test_list_to_pcre_handles_empty_input() -> None:
|
|||
def test_json_to_nginx_keeps_robots_txt_unblocked() -> None:
|
||||
config = robots.json_to_nginx({"BotA": {}})
|
||||
|
||||
assert 'if ($http_user_agent ~* "(BotA)")' in config
|
||||
assert 'if ($request_uri = "/robots.txt")' in config
|
||||
assert "return 403;" in config
|
||||
assert 'if ($http_user_agent ~* "(BotA)") {\n set $block 1;\n}' in config
|
||||
assert 'if ($request_uri = "/robots.txt") {\n set $block 0;\n}' in config
|
||||
assert "if ($block) {\n return 403;\n}" in config
|
||||
|
||||
# robots.txt allow rule must appear before the final deny block.
|
||||
assert config.index('if ($request_uri = "/robots.txt")') < config.index("if ($block)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue