MCPcopy Create free account
hub / github.com/pallets/flask / test_subdomain_basic_support

Function test_subdomain_basic_support

tests/test_basic.py:1747–1764  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1745
1746
1747def test_subdomain_basic_support():
1748 app = flask.Flask(__name__, subdomain_matching=True)
1749 app.config["SERVER_NAME"] = "localhost.localdomain"
1750 client = app.test_client()
1751
1752 @app.route("/")
1753 def normal_index():
1754 return "normal index"
1755
1756 @app.route("/", subdomain="test")
1757 def test_index():
1758 return "test index"
1759
1760 rv = client.get("/", "http://localhost.localdomain/")
1761 assert rv.data == b"normal index"
1762
1763 rv = client.get("/", "http://test.localhost.localdomain/")
1764 assert rv.data == b"test index"
1765
1766
1767def test_subdomain_matching():

Callers

nothing calls this directly

Calls 2

test_clientMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected