EnvironBuilder
An :class:~werkzeug.test.EnvironBuilder, that takes defaults from the application.
Attributes
| Attribute | Type | Description |
|---|---|---|
| app | [Flask](../app/flask.md?sid=src_flask_app_flask) | The Flask application to configure the environment from. |
Constructor
Signature
def EnvironBuilder(
app: [Flask](../app/flask.md?sid=src_flask_app_flask),
path: str = /,
base_url: str | None = None,
subdomain: str | None = None,
url_scheme: str | None = None,
*args: t.Any,
**kwargs: t.Any
) - > None
Parameters
| Name | Type | Description |
|---|---|---|
| app | [Flask](../app/flask.md?sid=src_flask_app_flask) | The Flask application to configure the environment from. |
| path | str = / | URL path being requested. |
| base_url | `str | None` = None |
| subdomain | `str | None` = None |
| url_scheme | `str | None` = None |
| *args | t.Any | Other positional arguments passed to the parent Werkzeug EnvironBuilder. |
| **kwargs | t.Any | Other keyword arguments passed to the parent Werkzeug EnvironBuilder. |
Signature
def EnvironBuilder(
app: [Flask](../app/flask.md?sid=src_flask_app_flask),
path: str = "/",
base_url: str | None = null,
subdomain: str | None = null,
url_scheme: str | None = null,
args: t.Any,
kwargs: t.Any
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| app | [Flask](../app/flask.md?sid=src_flask_app_flask) | The Flask application instance used to retrieve configuration defaults like SERVER_NAME and APPLICATION_ROOT. |
| path | str = "/" | The URL path for the request, which can include a query string. |
| base_url | `str | None` = null |
| subdomain | `str | None` = null |
| url_scheme | `str | None` = null |
| args | t.Any | Positional arguments passed directly to the underlying Werkzeug EnvironBuilder. |
| kwargs | t.Any | Keyword arguments passed directly to the underlying Werkzeug EnvironBuilder. |
Methods
json_dumps()
@classmethod
def json_dumps(
obj: t.Any,
kwargs: t.Any
) - > str
Serialize obj to a JSON-formatted string. The serialization will be configured according to the config associated with this EnvironBuilder's app.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | t.Any | The Python object to be serialized into a JSON string. |
| kwargs | t.Any | Additional keyword arguments passed to the application's JSON encoder. |
Returns
| Type | Description |
|---|---|
str | A JSON-formatted string representing the serialized object. |