bundle.testing.tools.references

Submodules

Classes

TestComplexData

Base data model class, providing utilities for serialization and deserialization

TestData

Base data model class, providing utilities for serialization and deserialization

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

TestEntity

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

Package Contents

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

Bases: bundle.core.data.Data

Base data model class, providing utilities for serialization and deserialization from/to JSON, along with JSON Schema generation.

model_config

Default model configuration settings.

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]
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.TestData(/, **data: Any)[source]

Bases: bundle.core.data.Data

Base data model class, providing utilities for serialization and deserialization from/to JSON, along with JSON Schema generation.

model_config

Default model configuration settings.

class bundle.testing.tools.references.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.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
class bundle.testing.tools.references.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