orionis 0.413.0__py3-none-any.whl → 0.414.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.413.0"
8
+ VERSION = "0.414.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -5,57 +5,77 @@ class BaseEntity:
5
5
 
6
6
  def toDict(self) -> dict:
7
7
  """
8
- Converts the current instance into a dictionary representation.
8
+ Converts the current dataclass instance into a dictionary.
9
+
10
+ Parameters
11
+ ----------
12
+ None
9
13
 
10
14
  Returns
11
15
  -------
12
16
  dict
13
- Dictionary representation of the current instance.
17
+ A dictionary containing all fields of the instance, with field names as keys and their corresponding values.
18
+
19
+ Notes
20
+ -----
21
+ This method uses `dataclasses.asdict` to recursively convert the dataclass instance and any nested dataclasses into dictionaries.
22
+ Enum values are preserved as their actual values.
14
23
  """
24
+
25
+ # Use asdict to convert the dataclass instance to a dictionary, including nested dataclasses
15
26
  return asdict(self)
16
27
 
17
28
  def getFields(self):
18
29
  """
19
- Retrieves a list of field information for the current dataclass instance.
30
+ Retrieves detailed information about each field in the current dataclass instance.
31
+
32
+ Parameters
33
+ ----------
34
+ None
20
35
 
21
36
  Returns
22
37
  -------
23
- list
24
- A list of dictionaries, each containing details about a field:
25
- - name (str): The name of the field.
26
- - type (type): The type of the field.
27
- - default: The default value of the field, if specified; otherwise, the value from metadata or None.
28
- - metadata (mapping): The metadata associated with the field.
38
+ list of dict
39
+ Each dictionary in the returned list contains:
40
+ - name (str): The name of the field.
41
+ - types (list of str): The type(s) of the field, represented as a list of type names.
42
+ - default: The default value of the field, resolved from the field definition, default factory, or metadata.
43
+ - metadata (dict): The metadata associated with the field.
44
+
45
+ Notes
46
+ -----
47
+ - Handles complex field types, including unions and generics, by representing them as lists of type names.
48
+ - Resolves default values from direct assignment, default factories, or metadata, and normalizes dataclass and Enum values.
49
+ - Metadata defaults are normalized if present and callable or dataclass/Enum types.
29
50
  """
30
- # Dictionary to hold field information
51
+
52
+ # List to hold field information dictionaries
31
53
  __fields = []
32
54
 
33
- # Iterate over the fields of the dataclass and extract relevant information
55
+ # Iterate over all fields defined in the dataclass
34
56
  for field in fields(self):
35
57
 
36
- # Get the field name
58
+ # Extract the field name
37
59
  __name = field.name
38
60
 
39
- # Get the field type with better handling for complex types
61
+ # Attempt to get the type name; handles simple types
40
62
  __type = getattr(field.type, '__name__', None)
41
63
 
42
- # If the type is None, handle it
64
+ # If type name is not available, handle complex types (e.g., Unions)
43
65
  if __type is None:
44
-
45
- # Handle Union types or other complex types
46
66
  type_lst = []
47
67
  type_str = str(field.type).split('|')
48
68
  for itype in type_str:
49
69
  type_lst.append(itype.strip())
50
70
  __type = type_lst
51
71
 
52
- # Ensure __type is a list for consistency
72
+ # Ensure __type is always a list for consistency
53
73
  __type = type_lst if isinstance(__type, list) else [__type]
54
74
 
55
- # Extract metadata, default value, and type
75
+ # Extract metadata as a dictionary
56
76
  metadata = dict(field.metadata) if field.metadata else {}
57
77
 
58
- # If metadata contains a default value, normalize it
78
+ # Normalize default value in metadata if present
59
79
  if 'default' in metadata:
60
80
  metadata_default = metadata['default']
61
81
  if callable(metadata_default):
@@ -66,13 +86,12 @@ class BaseEntity:
66
86
  metadata_default = metadata_default.value
67
87
  metadata['default'] = metadata_default
68
88
 
69
- # Add the field information to the list
70
89
  __metadata = metadata
71
90
 
72
- # Extract the default value, if specified
91
+ # Initialize default value
73
92
  __default = None
74
93
 
75
- # Field has a direct default value
94
+ # Resolve default value from field definition
76
95
  if field.default is not MISSING:
77
96
  __default = field.default() if callable(field.default) else field.default
78
97
  if is_dataclass(__default):
@@ -80,7 +99,7 @@ class BaseEntity:
80
99
  elif isinstance(__default, Enum):
81
100
  __default = __default.value
82
101
 
83
- # Field has a default factory (like list, dict, etc.)
102
+ # Resolve default value from default factory if present
84
103
  elif field.default_factory is not MISSING:
85
104
  __default = field.default_factory() if callable(field.default_factory) else field.default_factory
86
105
  if is_dataclass(__default):
@@ -88,11 +107,11 @@ class BaseEntity:
88
107
  elif isinstance(__default, Enum):
89
108
  __default = __default.value
90
109
 
91
- # No default found, check metadata for custom default
110
+ # If no default found, check metadata for custom default
92
111
  else:
93
112
  __default = __metadata.get('default', None)
94
113
 
95
- # Append the field information to the list
114
+ # Append the field information dictionary to the list
96
115
  __fields.append({
97
116
  "name": __name,
98
117
  "types": __type,
@@ -100,5 +119,5 @@ class BaseEntity:
100
119
  "metadata": __metadata
101
120
  })
102
121
 
103
- # Return the list of field information
122
+ # Return the list of field information dictionaries
104
123
  return __fields
@@ -5,11 +5,17 @@ class Console(Facade):
5
5
  @classmethod
6
6
  def getFacadeAccessor(cls) -> str:
7
7
  """
8
- Get the service container binding key for the dumper component.
8
+ Returns the service container binding key used to resolve the console component.
9
+
10
+ This method provides the unique string identifier that the service container uses
11
+ to locate and instantiate the console service. It is typically used internally
12
+ by the Facade base class to delegate calls to the underlying implementation.
9
13
 
10
14
  Returns
11
15
  -------
12
16
  str
13
- The service container binding key.
17
+ The string key `"core.orionis.console"` that identifies the console service in the container.
14
18
  """
19
+
20
+ # Return the binding key for the console service in the container
15
21
  return "core.orionis.console"
@@ -5,11 +5,17 @@ class Dumper(Facade):
5
5
  @classmethod
6
6
  def getFacadeAccessor(cls) -> str:
7
7
  """
8
- Get the service container binding key for the dumper component.
8
+ Returns the binding key used to retrieve the dumper component from the service container.
9
+
10
+ This method provides the unique string identifier that the service container uses to resolve
11
+ and return the dumper service instance. It is typically used internally by the Facade base class
12
+ to access the underlying implementation.
9
13
 
10
14
  Returns
11
15
  -------
12
16
  str
13
- The service container binding key.
17
+ The string "core.orionis.dumper", which is the service container binding key for the dumper component.
14
18
  """
19
+
20
+ # Return the service container binding key for the dumper component
15
21
  return "core.orionis.dumper"
@@ -5,11 +5,18 @@ class Log(Facade):
5
5
  @classmethod
6
6
  def getFacadeAccessor(cls) -> str:
7
7
  """
8
- Get the service container binding key for the dumper component.
8
+ Returns the binding key used to resolve the logger service from the service container.
9
+
10
+ This method provides the unique identifier required by the service container to retrieve
11
+ the logger component. It is used internally by the Facade base class to delegate calls
12
+ to the appropriate service implementation.
9
13
 
10
14
  Returns
11
15
  -------
12
16
  str
13
- The service container binding key.
17
+ The binding key for the logger service in the service container, specifically
18
+ "core.orionis.logger".
14
19
  """
20
+
21
+ # Return the service container binding key for the logger component
15
22
  return "core.orionis.logger"
@@ -5,11 +5,18 @@ class PathResolver(Facade):
5
5
  @classmethod
6
6
  def getFacadeAccessor(cls):
7
7
  """
8
- Get the service container binding key for the dumper component.
8
+ Returns the service container binding key used to resolve the path resolver component.
9
+
10
+ This method provides the unique string identifier that the service container uses
11
+ to locate and retrieve the path resolver service. It is typically used internally
12
+ by the facade mechanism to delegate calls to the appropriate underlying implementation.
9
13
 
10
14
  Returns
11
15
  -------
12
16
  str
13
- The service container binding key.
17
+ The string key "core.orionis.path_resolver" that identifies the path resolver
18
+ service in the container.
14
19
  """
20
+
21
+ # Return the binding key for the path resolver service in the container
15
22
  return "core.orionis.path_resolver"
@@ -5,11 +5,18 @@ class ProgressBar(Facade):
5
5
  @classmethod
6
6
  def getFacadeAccessor(cls):
7
7
  """
8
- Get the service container binding key for the dumper component.
8
+ Returns the binding key used to retrieve the progress bar service from the service container.
9
+
10
+ This method provides the unique string identifier that the service container uses to resolve
11
+ the progress bar component. It is typically used internally by the Facade system to access
12
+ the underlying implementation.
9
13
 
10
14
  Returns
11
15
  -------
12
16
  str
13
- The service container binding key.
17
+ The binding key for the progress bar service in the service container, specifically
18
+ "core.orionis.progress_bar".
14
19
  """
20
+
21
+ # Return the service container binding key for the progress bar component
15
22
  return "core.orionis.progress_bar"
@@ -5,11 +5,18 @@ class Test(Facade):
5
5
  @classmethod
6
6
  def getFacadeAccessor(cls) -> str:
7
7
  """
8
- Get the service container binding key for the dumper component.
8
+ Returns the service container binding key for the testing component.
9
+
10
+ This method provides the unique string identifier used by the service container
11
+ to resolve the testing component. It is typically used internally by the Facade
12
+ system to retrieve the correct implementation from the container.
9
13
 
10
14
  Returns
11
15
  -------
12
16
  str
13
- The service container binding key.
17
+ The string key "core.orionis.testing" that identifies the testing component
18
+ in the service container.
14
19
  """
20
+
21
+ # Return the binding key for the testing component in the service container
15
22
  return "core.orionis.testing"
@@ -5,11 +5,18 @@ class Workers(Facade):
5
5
  @classmethod
6
6
  def getFacadeAccessor(cls):
7
7
  """
8
- Get the service container binding key for the dumper component.
8
+ Returns the service container binding key for the workers component.
9
+
10
+ This method provides the unique string identifier used by the service container
11
+ to resolve the workers service. It is typically used internally by the Facade
12
+ mechanism to access the underlying implementation.
9
13
 
10
14
  Returns
11
15
  -------
12
16
  str
13
- The service container binding key.
17
+ The string key "core.orionis.workers" that identifies the workers service
18
+ in the service container.
14
19
  """
20
+
21
+ # Return the binding key for the workers service in the container
15
22
  return "core.orionis.workers"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.413.0
3
+ Version: 0.414.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -258,7 +258,7 @@ orionis/foundation/providers/progress_bar_provider.py,sha256=WW3grNgH-yV2meSSTeO
258
258
  orionis/foundation/providers/testing_provider.py,sha256=iJSN2RIChbYIL-1ue6vmPmDMCSrvERDkti4Er9MPiLA,1102
259
259
  orionis/foundation/providers/workers_provider.py,sha256=kiQjQRyUEyiBX2zcbF_KmqRgvc7Bvxsvg5oMtIvYniM,1075
260
260
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
261
- orionis/metadata/framework.py,sha256=jqDMZrSdfmPEJySPYTgu3zVGmQxZLzJKHYcCjiIq5TQ,4960
261
+ orionis/metadata/framework.py,sha256=scI_a_NbPmaG7Rcwj0yNpwodYHHU3Hi_q0gLxzIRCdg,4960
262
262
  orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
263
263
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
264
264
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -354,15 +354,15 @@ orionis/services/system/runtime/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
354
354
  orionis/services/system/runtime/imports.py,sha256=iIwIx8RjBHaiveCdj_WPiMMbWsKGbIs02qpAzL_L3Z0,3158
355
355
  orionis/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
356
356
  orionis/support/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
357
- orionis/support/entities/base.py,sha256=4WuAzrk_sfWp8Wv5Yl9IUF6kTctlAXlSxHGh5mdu3MQ,3982
357
+ orionis/support/entities/base.py,sha256=UKDEpScz7ZeckCqD9TNxAhk0ZN9UPgrRQOpUUHVtfqg,4845
358
358
  orionis/support/facades/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
359
- orionis/support/facades/console.py,sha256=Hx_VGZazpdPDkg1LgcCTzgASq7blzazGHXVNp2uN5w8,372
360
- orionis/support/facades/dumper.py,sha256=JD0xT11ReLlzTH1O5wdIG1-r9sg1nriJnhtqkLsavW8,370
361
- orionis/support/facades/logger.py,sha256=TWJP2OKiGIECnPqbCbxxNpgbhSFeqVaQkYOIVclYPdk,367
362
- orionis/support/facades/path_resolver.py,sha256=-ro3-yxmjKHngf6aOy2dzyeNulsiSJuxu__vJWsRuUA,376
363
- orionis/support/facades/progress_bar.py,sha256=ZmU7hojRP88PM39BX1fN0_2pTCUhOXdIqyKaQwPoQ-A,374
364
- orionis/support/facades/testing.py,sha256=sDnW_jzM_uU1Cyrg-6tFnpb45k_OiSy3_QNdlF2WOck,369
365
- orionis/support/facades/workers.py,sha256=XbDYSh_LCRzQI1jNEtBrB82Q6_iRg7i8lEzuyF5Om9E,365
359
+ orionis/support/facades/console.py,sha256=YAVAdP0TjLjKoBVU18mVl1MtMGWjbKJoYxZRlm1ZwUI,792
360
+ orionis/support/facades/dumper.py,sha256=Yxn_6sU3ijo8dXGZRDLi_S2lNJoeJtCeLX5GI4Jn0u4,803
361
+ orionis/support/facades/logger.py,sha256=VpDp7iXfAnkHxCQvwhcIT1XdJAWOfLsEkY-u_mGIuN8,796
362
+ orionis/support/facades/path_resolver.py,sha256=V_Mxf5-REBp9boeTR4FGM4M_QwGlIeRQIEoX-kb164g,845
363
+ orionis/support/facades/progress_bar.py,sha256=JB3CvXrlnBLONdQ0lygOYs1FAzYnXQLtih8C3R7xP8g,824
364
+ orionis/support/facades/testing.py,sha256=ZGRe0zhcgybKb8yx-Ysskg2c7FlTdss52uBYdGV8EeU,796
365
+ orionis/support/facades/workers.py,sha256=jJNFE_yjy-3uaqG8ynPTagnwOFLSGC50PsveDG4t4uE,763
366
366
  orionis/support/formatter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
367
367
  orionis/support/formatter/serializer.py,sha256=g816osgwYzAzCnduDh2IyHvXx-fEhnVmw8EPZkDT5Ak,522
368
368
  orionis/support/formatter/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -428,7 +428,7 @@ orionis/test/validators/web_report.py,sha256=-h3Fe9jY93_kzUhd2NBIqEfCcBpu-8Ei9x3
428
428
  orionis/test/validators/workers.py,sha256=LGffDKtK6SKixFKzIYPQpI5aFeQPAGXpv_LUtmEu6g4,1102
429
429
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
430
430
  orionis/test/view/render.py,sha256=3ICz68l-WF3BtnYqH5m-ktN9UD00MELMbmMnyJDV74A,4768
431
- orionis-0.413.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
431
+ orionis-0.414.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
432
432
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
433
433
  tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
434
434
  tests/container/test_container.py,sha256=asv8TkkupVoex6SWod74NBl4dSs7wb9mLmu_glNdNy8,14815
@@ -547,6 +547,9 @@ tests/services/system/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
547
547
  tests/services/system/test_services_system_imports.py,sha256=jbtIQkw_4DI6x2E-4Lg3evnLAgCgDIBWE63LdJTLkxc,7507
548
548
  tests/services/system/test_services_system_workers.py,sha256=wITbpJHKW_OXqTaFeteNRFuw5Q3_7d9lWNJnFE2r6to,5052
549
549
  tests/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
550
+ tests/support/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
551
+ tests/support/entities/mock_dataclass.py,sha256=TZk4D1SdKqqz1kNaqLoMPlsl8s7dWOHIkSK5FsbyPRI,990
552
+ tests/support/entities/test_base.py,sha256=z9lpDm8iY-gP-jv2VsLD-60NT-peBoTpB5jUsLt6V-A,2441
550
553
  tests/support/patterns/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
551
554
  tests/support/patterns/singleton/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
552
555
  tests/support/patterns/singleton/test_patterns_singleton.py,sha256=L7Q2QEBwSdG_JGfSB4s4AKqxsV4cXeKR1d8V7MbyzFY,1461
@@ -557,8 +560,8 @@ tests/support/wrapper/test_services_wrapper_docdict.py,sha256=Q_qyqZodLiTQ6Pv9zI
557
560
  tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
558
561
  tests/testing/test_testing_result.py,sha256=aWOOJiHji_U7gcJHbDukgMmfBEEQCLQdyqpXJD5q4BE,4643
559
562
  tests/testing/test_testing_unit.py,sha256=Krz0Bw1toI9qvLtKtYe_slNvi7fYmZbHK1i4DRPMfUM,7952
560
- orionis-0.413.0.dist-info/METADATA,sha256=8xX9dll3RRMvC3_CLaMeRkUz59AoQUgxpEceM0lRF9w,4772
561
- orionis-0.413.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
562
- orionis-0.413.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
563
- orionis-0.413.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
564
- orionis-0.413.0.dist-info/RECORD,,
563
+ orionis-0.414.0.dist-info/METADATA,sha256=rhoe5G18U85hjxlnKnYW9d6IQvL-sDyX81qYGfNT2M4,4772
564
+ orionis-0.414.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
565
+ orionis-0.414.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
566
+ orionis-0.414.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
567
+ orionis-0.414.0.dist-info/RECORD,,
File without changes
@@ -0,0 +1,34 @@
1
+ from dataclasses import dataclass, field
2
+ from enum import Enum
3
+ from orionis.support.entities.base import BaseEntity
4
+
5
+ class Color(Enum):
6
+ """Enumeration for available colors."""
7
+ RED = 1
8
+ GREEN = 2
9
+
10
+ @dataclass
11
+ class ExampleEntity(BaseEntity):
12
+ """
13
+ Example entity representing a data structure with id, name, color, and tags.
14
+
15
+ Attributes
16
+ ----------
17
+ id : int
18
+ Unique identifier for the entity.
19
+ name : str
20
+ Name of the entity.
21
+ color : Color
22
+ Color associated with the entity.
23
+ tags : list
24
+ List of tags associated with the entity.
25
+
26
+ Returns
27
+ -------
28
+ ExampleEntity
29
+ An instance of ExampleEntity with specified attributes.
30
+ """
31
+ id: int = 0 # Default id is 0
32
+ name: str = "default" # Default name is 'default'
33
+ color: Color = Color.RED # Default color is RED
34
+ tags: list = field(default_factory=list, metadata={"default": ["tag1", "tag2"]}) # Default tags list
@@ -0,0 +1,72 @@
1
+ from orionis.test.cases.asynchronous import AsyncTestCase
2
+ from tests.support.entities.mock_dataclass import Color, ExampleEntity
3
+
4
+ class TestBaseEntity(AsyncTestCase):
5
+
6
+ async def asyncSetUp(self):
7
+ """
8
+ Set up the test case asynchronously by initializing an ExampleEntity instance.
9
+
10
+ This method is called before each test coroutine to prepare the test environment.
11
+ It creates an ExampleEntity with predefined attributes.
12
+
13
+ Returns
14
+ -------
15
+ None
16
+ This method does not return any value.
17
+ """
18
+ # Create an ExampleEntity instance for use in tests
19
+ self.entity = ExampleEntity(id=42, name="test", color=Color.GREEN, tags=["a", "b"])
20
+
21
+ async def testToDict(self):
22
+ """
23
+ Test the toDict method of ExampleEntity.
24
+
25
+ Verifies that the toDict method returns a dictionary representation of the entity
26
+ with correct field values.
27
+
28
+ Returns
29
+ -------
30
+ None
31
+ This method does not return any value.
32
+ """
33
+
34
+ # Convert entity to dictionary
35
+ result = self.entity.toDict()
36
+ self.assertIsInstance(result, dict)
37
+
38
+ # Check individual field values
39
+ self.assertEqual(result["id"], 42)
40
+ self.assertEqual(result["name"], "test")
41
+ self.assertEqual(result["color"], Color.GREEN)
42
+ self.assertEqual(result["tags"], ["a", "b"])
43
+
44
+ async def testGetFields(self):
45
+ """
46
+ Test the getFields method of ExampleEntity.
47
+
48
+ Ensures that getFields returns a list of field information dictionaries,
49
+ each containing field name, types, default value, and metadata.
50
+
51
+ Returns
52
+ -------
53
+ None
54
+ This method does not return any value.
55
+ """
56
+
57
+ # Retrieve field information from entity
58
+ fields_info = self.entity.getFields()
59
+ self.assertIsInstance(fields_info, list)
60
+
61
+ # Extract field names for verification
62
+ names = [f["name"] for f in fields_info]
63
+ self.assertIn("id", names)
64
+ self.assertIn("name", names)
65
+ self.assertIn("color", names)
66
+ self.assertIn("tags", names)
67
+
68
+ # Check that each field info contains required keys
69
+ for f in fields_info:
70
+ self.assertIn("types", f)
71
+ self.assertIn("default", f)
72
+ self.assertIn("metadata", f)