MCPcopy
hub / github.com/pallets/werkzeug / test_invalid_subdomain_warning

Function test_invalid_subdomain_warning

tests/test_routing.py:507–514  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

505
506
507def test_invalid_subdomain_warning():
508 env = create_environ("/foo")
509 env["SERVER_NAME"] = env["HTTP_HOST"] = "foo.example.com"
510 m = r.Map([r.Rule("/foo", endpoint="foo")])
511 with pytest.warns(UserWarning) as record:
512 a = m.bind_to_environ(env, server_name="bar.example.com")
513 assert a.subdomain == "<invalid>"
514 assert len(record) == 1
515
516
517@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

bind_to_environMethod · 0.95
create_environFunction · 0.90

Tested by

no test coverage detected