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 = None
identifier: bundle.core.entity.Identifier = None
version: str = None
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 = None
info: str = None
timestamp: datetime.datetime = None
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: None | list[RecursiveModel] = 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 = None
int_field: int = None
float_field: float = None
bool_field: bool = None
optional_field: None | str = None
list_field: list[int] = None
set_field: set[str] = None
dict_field: dict[str, int] = None
dict_complex_field: dict[str, pathlib.Path] = None
union_field: int | str = None
nested_model: NestedModel = None
nested_model_list: list[NestedModel] = None
optional_nested_model: None | NestedModel = None
recursive_model: RecursiveModel = None
dynamic_default_field: str = None
file_path: pathlib.Path = None
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 = None