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 = 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
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.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 = 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.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
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 = None
identifier: bundle.core.entity.Identifier = None
version: str = None