()
| 1745 | |
| 1746 | |
| 1747 | def 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 | |
| 1767 | def test_subdomain_matching(): |
nothing calls this directly
no test coverage detected