bundle.testing.tools.references.entity

Attributes

Classes

TestEntity

An extension of the Data model that represents an entity with enhanced introspection

NestedModel

An extension of the Data model that represents an entity with enhanced introspection

RecursiveModel

An extension of the Data model that represents an entity with enhanced introspection

TestComplexEntity

An extension of the Data model that represents an entity with enhanced introspection

TestComplexEntityMultipleInheritance

An extension of the Data model that represents an entity with enhanced introspection

Module Contents

bundle.testing.tools.references.entity.JSON_ENCODERS
bundle.testing.tools.references.entity.NAMESPACE
bundle.testing.tools.references.entity.UNIQUE_GENERATOR_ACTIVE = True
class bundle.testing.tools.references.entity.TestEntity(/, **data: Any)[source]

Bases: bundle.core.Entity

An extension of the Data model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity’s creation time and can automatically save its state upon destruction if configured to do so.

name

The name of the entity, with a default value of “Default”.

Type:

str

born_time

The timestamp of entity instantiation, in nanoseconds.

Type:

int

Properties:

class_name (str): The name of the entity’s class. age (int): The age of the entity in nanoseconds, calculated from its born_time.

born_time: int
identifier: bundle.core.entity.Identifier
version: str
class bundle.testing.tools.references.entity.NestedModel(/, **data: Any)[source]

Bases: TestEntity

An extension of the Data model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity’s creation time and can automatically save its state upon destruction if configured to do so.

name

The name of the entity, with a default value of “Default”.

Type:

str

born_time

The timestamp of entity instantiation, in nanoseconds.

Type:

int

Properties:

class_name (str): The name of the entity’s class. age (int): The age of the entity in nanoseconds, calculated from its born_time.

id: int
info: str
timestamp: datetime.datetime
model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class bundle.testing.tools.references.entity.RecursiveModel(/, **data: Any)[source]

Bases: TestEntity

An extension of the Data model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity’s creation time and can automatically save its state upon destruction if configured to do so.

name

The name of the entity, with a default value of “Default”.

Type:

str

born_time

The timestamp of entity instantiation, in nanoseconds.

Type:

int

Properties:

class_name (str): The name of the entity’s class. age (int): The age of the entity in nanoseconds, calculated from its born_time.

children: list[RecursiveModel] | None = None
model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class bundle.testing.tools.references.entity.TestComplexEntity(/, **data: Any)[source]

Bases: TestEntity

An extension of the Data model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity’s creation time and can automatically save its state upon destruction if configured to do so.

name

The name of the entity, with a default value of “Default”.

Type:

str

born_time

The timestamp of entity instantiation, in nanoseconds.

Type:

int

Properties:

class_name (str): The name of the entity’s class. age (int): The age of the entity in nanoseconds, calculated from its born_time.

string_field: str
int_field: int
float_field: float
bool_field: bool
optional_field: str | None
list_field: list[int]
set_field: set[str]
dict_field: dict[str, int]
dict_complex_field: dict[str, pathlib.Path]
union_field: int | str
nested_model: NestedModel
nested_model_list: list[NestedModel]
optional_nested_model: NestedModel | None
recursive_model: RecursiveModel
dynamic_default_field: str
file_path: pathlib.Path
model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

check_positive(value)[source]
check_dynamic_default_based_on_int_field()[source]
class bundle.testing.tools.references.entity.TestComplexEntityMultipleInheritance(/, **data: Any)[source]

Bases: RecursiveModel, bundle.testing.tools.references.data.TestComplexData

An extension of the Data model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity’s creation time and can automatically save its state upon destruction if configured to do so.

name

The name of the entity, with a default value of “Default”.

Type:

str

born_time

The timestamp of entity instantiation, in nanoseconds.

Type:

int

Properties:

class_name (str): The name of the entity’s class. age (int): The age of the entity in nanoseconds, calculated from its born_time.

born_time: int