orionis 0.285.0__py3-none-any.whl → 0.287.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.
Files changed (67) hide show
  1. orionis/metadata/framework.py +1 -1
  2. orionis/services/asynchrony/contracts/__init__.py +0 -0
  3. orionis/services/asynchrony/contracts/coroutines.py +24 -0
  4. orionis/services/asynchrony/coroutines.py +58 -19
  5. orionis/services/asynchrony/exceptions/coroutine_exception.py +8 -15
  6. orionis/services/environment/contracts/env.py +45 -50
  7. orionis/services/environment/dot_env.py +205 -181
  8. orionis/services/environment/env.py +68 -85
  9. orionis/services/environment/exceptions/environment_value_error.py +18 -0
  10. orionis/services/environment/exceptions/environment_value_exception.py +23 -0
  11. orionis/services/environment/type_hint.py +559 -0
  12. orionis/test/exceptions/test_config_exception.py +8 -17
  13. orionis/test/exceptions/test_failure_exception.py +27 -27
  14. orionis/test/exceptions/test_persistence_error.py +10 -20
  15. orionis/test/exceptions/test_runtime_error.py +8 -15
  16. orionis/test/exceptions/test_value_error.py +8 -15
  17. orionis/test/logs/history.py +3 -5
  18. {orionis-0.285.0.dist-info → orionis-0.287.0.dist-info}/METADATA +1 -1
  19. {orionis-0.285.0.dist-info → orionis-0.287.0.dist-info}/RECORD +66 -62
  20. tests/example/test_example.py +5 -2
  21. tests/foundation/config/app/test_app.py +13 -3
  22. tests/foundation/config/auth/test_auth.py +9 -4
  23. tests/foundation/config/cache/test_cache.py +60 -15
  24. tests/foundation/config/cache/test_cache_file.py +62 -14
  25. tests/foundation/config/cache/test_cache_stores.py +74 -14
  26. tests/foundation/config/cors/test_cors.py +102 -33
  27. tests/foundation/config/database/test_database.py +38 -14
  28. tests/foundation/config/database/test_database_connections.py +79 -5
  29. tests/foundation/config/database/test_database_mysql.py +138 -15
  30. tests/foundation/config/database/test_database_oracle.py +110 -26
  31. tests/foundation/config/database/test_database_pgsql.py +96 -26
  32. tests/foundation/config/database/test_database_sqlite.py +56 -2
  33. tests/foundation/config/exceptions/test_exceptions_integrity.py +44 -10
  34. tests/foundation/config/filesystems/test_filesystems.py +64 -14
  35. tests/foundation/config/filesystems/test_filesystems_aws.py +45 -7
  36. tests/foundation/config/filesystems/test_filesystems_disks.py +78 -8
  37. tests/foundation/config/filesystems/test_filesystems_local.py +66 -18
  38. tests/foundation/config/filesystems/test_filesystems_public.py +37 -0
  39. tests/foundation/config/logging/test_logging.py +75 -11
  40. tests/foundation/config/logging/test_logging_channels.py +79 -2
  41. tests/foundation/config/logging/test_logging_chunked.py +85 -12
  42. tests/foundation/config/logging/test_logging_daily.py +79 -12
  43. tests/foundation/config/logging/test_logging_hourly.py +68 -2
  44. tests/foundation/config/logging/test_logging_monthly.py +48 -2
  45. tests/foundation/config/logging/test_logging_stack.py +49 -14
  46. tests/foundation/config/logging/test_logging_weekly.py +92 -2
  47. tests/foundation/config/mail/test_mail.py +87 -15
  48. tests/foundation/config/mail/test_mail_file.py +40 -4
  49. tests/foundation/config/mail/test_mail_mailers.py +56 -8
  50. tests/foundation/config/mail/test_mail_smtp.py +58 -14
  51. tests/foundation/config/queue/test_queue.py +62 -9
  52. tests/foundation/config/queue/test_queue_brokers.py +27 -10
  53. tests/foundation/config/queue/test_queue_database.py +53 -15
  54. tests/foundation/config/root/test_root_paths.py +69 -2
  55. tests/foundation/config/session/test_session.py +30 -1
  56. tests/foundation/config/startup/test_config_startup.py +77 -7
  57. tests/foundation/config/testing/test_testing.py +68 -0
  58. tests/patterns/singleton/test_singleton.py +10 -1
  59. tests/services/asynchrony/test_async_io.py +4 -4
  60. tests/services/environment/test_env.py +3 -4
  61. tests/testing/test_testing_result.py +56 -19
  62. tests/testing/test_testing_unit.py +93 -24
  63. orionis/services/environment/exceptions/value_exception.py +0 -27
  64. {orionis-0.285.0.dist-info → orionis-0.287.0.dist-info}/WHEEL +0 -0
  65. {orionis-0.285.0.dist-info → orionis-0.287.0.dist-info}/licenses/LICENCE +0 -0
  66. {orionis-0.285.0.dist-info → orionis-0.287.0.dist-info}/top_level.txt +0 -0
  67. {orionis-0.285.0.dist-info → orionis-0.287.0.dist-info}/zip-safe +0 -0
@@ -5,20 +5,33 @@ from orionis.unittesting import TestCase
5
5
  class TestConfigFile(TestCase):
6
6
  """
7
7
  Test cases for the File cache configuration entity.
8
+
9
+ This class contains unit tests for the `File` cache configuration entity,
10
+ validating its initialization, path handling, and dictionary representation.
8
11
  """
9
12
 
10
13
  async def testDefaultPath(self):
11
14
  """
12
- Test that the File instance is created with the correct default path.
13
- Verifies that the default path matches the expected value from the class definition.
15
+ Test default path initialization.
16
+
17
+ Ensures that a `File` instance is created with the correct default path.
18
+
19
+ Returns
20
+ -------
21
+ None
14
22
  """
15
23
  file_config = File()
16
24
  self.assertEqual(file_config.path, 'storage/framework/cache/data')
17
25
 
18
26
  async def testCustomPath(self):
19
27
  """
20
- Test that a custom path can be set during initialization.
21
- Verifies that the path attribute accepts and stores valid custom paths.
28
+ Test custom path initialization.
29
+
30
+ Ensures that a custom path can be set during initialization and is stored correctly.
31
+
32
+ Returns
33
+ -------
34
+ None
22
35
  """
23
36
  custom_path = 'custom/cache/path'
24
37
  file_config = File(path=custom_path)
@@ -26,16 +39,36 @@ class TestConfigFile(TestCase):
26
39
 
27
40
  async def testEmptyPathValidation(self):
28
41
  """
29
- Test that empty paths are rejected.
30
- Verifies that an empty path raises an OrionisIntegrityException.
42
+ Test validation for empty path.
43
+
44
+ Ensures that providing an empty path raises an `OrionisIntegrityException`.
45
+
46
+ Returns
47
+ -------
48
+ None
49
+
50
+ Raises
51
+ ------
52
+ OrionisIntegrityException
53
+ If the path is empty.
31
54
  """
32
55
  with self.assertRaises(OrionisIntegrityException):
33
56
  File(path="")
34
57
 
35
58
  async def testPathTypeValidation(self):
36
59
  """
37
- Test that non-string paths are rejected.
38
- Verifies that non-string path values raise an OrionisIntegrityException.
60
+ Test validation for path type.
61
+
62
+ Ensures that non-string path values raise an `OrionisIntegrityException`.
63
+
64
+ Returns
65
+ -------
66
+ None
67
+
68
+ Raises
69
+ ------
70
+ OrionisIntegrityException
71
+ If the path is not a string.
39
72
  """
40
73
  with self.assertRaises(OrionisIntegrityException):
41
74
  File(path=123)
@@ -48,8 +81,13 @@ class TestConfigFile(TestCase):
48
81
 
49
82
  async def testToDictMethod(self):
50
83
  """
51
- Test that the toDict method returns a proper dictionary representation.
52
- Verifies that the returned dictionary contains the expected path value.
84
+ Test dictionary representation.
85
+
86
+ Ensures that the `toDict` method returns a dictionary with the expected path value.
87
+
88
+ Returns
89
+ -------
90
+ None
53
91
  """
54
92
  file_config = File()
55
93
  config_dict = file_config.toDict()
@@ -59,8 +97,13 @@ class TestConfigFile(TestCase):
59
97
 
60
98
  async def testCustomPathToDict(self):
61
99
  """
62
- Test that custom paths are properly included in the dictionary representation.
63
- Verifies that toDict() includes custom path values when specified.
100
+ Test custom path in dictionary representation.
101
+
102
+ Ensures that custom paths are properly included in the dictionary returned by `toDict`.
103
+
104
+ Returns
105
+ -------
106
+ None
64
107
  """
65
108
  custom_path = 'another/cache/location'
66
109
  file_config = File(path=custom_path)
@@ -70,8 +113,13 @@ class TestConfigFile(TestCase):
70
113
 
71
114
  async def testWhitespacePathHandling(self):
72
115
  """
73
- Test that paths with whitespace are accepted but not automatically trimmed.
74
- Verifies that the validation allows paths containing whitespace characters.
116
+ Test handling of paths with whitespace.
117
+
118
+ Ensures that paths containing whitespace are accepted and not automatically trimmed.
119
+
120
+ Returns
121
+ -------
122
+ None
75
123
  """
76
124
  spaced_path = ' storage/cache/with/space '
77
125
  file_config = File(path=spaced_path)
@@ -6,12 +6,26 @@ from orionis.unittesting import TestCase
6
6
  class TestConfigStores(TestCase):
7
7
  """
8
8
  Test cases for the Stores cache configuration entity.
9
+
10
+ This class contains asynchronous unit tests for the `Stores` entity,
11
+ validating its initialization, type enforcement, dictionary conversion,
12
+ hashability, and keyword-only argument enforcement.
13
+
14
+ Attributes
15
+ ----------
16
+ None
9
17
  """
10
18
 
11
19
  async def testDefaultFileStore(self):
12
20
  """
13
- Test that Stores initializes with a default File instance.
14
- Verifies that the file attribute is properly initialized with default File configuration.
21
+ Test initialization with default File instance.
22
+
23
+ Ensures that `Stores` initializes with a default `File` instance and
24
+ that the `file` attribute is properly set with the default configuration.
25
+
26
+ Returns
27
+ -------
28
+ None
15
29
  """
16
30
  stores = Stores()
17
31
  self.assertIsInstance(stores.file, File)
@@ -19,8 +33,14 @@ class TestConfigStores(TestCase):
19
33
 
20
34
  async def testCustomFileStore(self):
21
35
  """
22
- Test that Stores accepts a custom File configuration.
23
- Verifies that a custom File instance can be provided during initialization.
36
+ Test initialization with a custom File configuration.
37
+
38
+ Ensures that a custom `File` instance can be provided during
39
+ initialization and is correctly assigned to the `file` attribute.
40
+
41
+ Returns
42
+ -------
43
+ None
24
44
  """
25
45
  custom_file = File(path='custom/cache/path')
26
46
  stores = Stores(file=custom_file)
@@ -29,8 +49,19 @@ class TestConfigStores(TestCase):
29
49
 
30
50
  async def testFileTypeValidation(self):
31
51
  """
32
- Test that Stores validates the file attribute type.
33
- Verifies that non-File instances raise OrionisIntegrityException.
52
+ Test type validation for the file attribute.
53
+
54
+ Ensures that providing a non-`File` instance to the `file` attribute
55
+ raises an `OrionisIntegrityException`.
56
+
57
+ Returns
58
+ -------
59
+ None
60
+
61
+ Raises
62
+ ------
63
+ OrionisIntegrityException
64
+ If the `file` attribute is not a `File` instance.
34
65
  """
35
66
  with self.assertRaises(OrionisIntegrityException):
36
67
  Stores(file="not_a_file_instance")
@@ -43,8 +74,14 @@ class TestConfigStores(TestCase):
43
74
 
44
75
  async def testToDictMethodWithDefaults(self):
45
76
  """
46
- Test that toDict returns proper dictionary with default values.
47
- Verifies the dictionary representation contains the correct default file path.
77
+ Test dictionary representation with default values.
78
+
79
+ Ensures that `toDict` returns a dictionary with the correct default
80
+ file path.
81
+
82
+ Returns
83
+ -------
84
+ None
48
85
  """
49
86
  stores = Stores()
50
87
  stores_dict = stores.toDict()
@@ -55,8 +92,14 @@ class TestConfigStores(TestCase):
55
92
 
56
93
  async def testToDictMethodWithCustomFile(self):
57
94
  """
58
- Test that toDict includes custom file configurations.
59
- Verifies the dictionary representation reflects custom file paths.
95
+ Test dictionary representation with custom file configuration.
96
+
97
+ Ensures that `toDict` reflects custom file paths in its dictionary
98
+ representation.
99
+
100
+ Returns
101
+ -------
102
+ None
60
103
  """
61
104
  custom_file = File(path='alternate/cache/location')
62
105
  stores = Stores(file=custom_file)
@@ -66,8 +109,14 @@ class TestConfigStores(TestCase):
66
109
 
67
110
  async def testHashability(self):
68
111
  """
69
- Test that Stores maintains hashability due to unsafe_hash=True.
70
- Verifies that Stores instances can be used in sets and as dictionary keys.
112
+ Test hashability of Stores instances.
113
+
114
+ Ensures that `Stores` instances are hashable and can be used in sets
115
+ and as dictionary keys.
116
+
117
+ Returns
118
+ -------
119
+ None
71
120
  """
72
121
  store1 = Stores()
73
122
  store2 = Stores()
@@ -81,8 +130,19 @@ class TestConfigStores(TestCase):
81
130
 
82
131
  async def testKwOnlyInitialization(self):
83
132
  """
84
- Test that Stores enforces keyword-only initialization.
85
- Verifies that positional arguments are not allowed for initialization.
133
+ Test keyword-only initialization enforcement.
134
+
135
+ Ensures that `Stores` enforces keyword-only arguments and does not
136
+ allow positional arguments during initialization.
137
+
138
+ Returns
139
+ -------
140
+ None
141
+
142
+ Raises
143
+ ------
144
+ TypeError
145
+ If positional arguments are provided during initialization.
86
146
  """
87
147
  with self.assertRaises(TypeError):
88
148
  Stores(File())
@@ -1,4 +1,3 @@
1
-
2
1
  from orionis.foundation.config.cors.entities.cors import Cors
3
2
  from orionis.foundation.config.exceptions.integrity import OrionisIntegrityException
4
3
  from orionis.unittesting import TestCase
@@ -6,20 +5,35 @@ from orionis.unittesting import TestCase
6
5
  class TestCorsConfig(TestCase):
7
6
  """
8
7
  Unit tests for Cors configuration defaults and validation.
8
+
9
+ Notes
10
+ -----
11
+ These tests verify the default values, custom value assignment, and type validation
12
+ for the `Cors` configuration entity.
9
13
  """
10
14
 
11
15
  async def testDefaultValues(self):
12
16
  """
13
17
  Test the default values of the Cors configuration.
14
18
 
15
- This test verifies that a newly instantiated Cors object has the following default settings:
16
- - allow_origins: ["*"]
17
- - allow_origin_regex: None
18
- - allow_methods: ["*"]
19
- - allow_headers: ["*"]
20
- - expose_headers: []
21
- - allow_credentials: False
22
- - max_age: 600
19
+ Verifies that a newly instantiated Cors object has the expected default settings.
20
+
21
+ Expected Defaults
22
+ -----------------
23
+ allow_origins : list of str
24
+ ["*"]
25
+ allow_origin_regex : None or str
26
+ None
27
+ allow_methods : list of str
28
+ ["*"]
29
+ allow_headers : list of str
30
+ ["*"]
31
+ expose_headers : list of str
32
+ []
33
+ allow_credentials : bool
34
+ False
35
+ max_age : int
36
+ 600
23
37
  """
24
38
  cors = Cors()
25
39
  self.assertEqual(cors.allow_origins, ["*"])
@@ -32,18 +46,26 @@ class TestCorsConfig(TestCase):
32
46
 
33
47
  async def testCustomValues(self):
34
48
  """
35
- Test that the Cors configuration correctly sets custom values for all parameters.
49
+ Test custom value assignment for all Cors configuration parameters.
36
50
 
37
- This test verifies that:
38
- - `allow_origins` is set to the provided list of origins.
39
- - `allow_origin_regex` is set to the provided regex pattern.
40
- - `allow_methods` is set to the provided list of HTTP methods.
41
- - `allow_headers` is set to the provided list of headers.
42
- - `expose_headers` is set to the provided list of exposed headers.
43
- - `allow_credentials` is set to True.
44
- - `max_age` is set to the provided integer value.
51
+ Ensures that the Cors object accurately reflects the provided custom configuration values.
45
52
 
46
- Ensures that the Cors object accurately reflects the custom configuration values.
53
+ Parameters
54
+ ----------
55
+ allow_origins : list of str
56
+ Custom list of allowed origins.
57
+ allow_origin_regex : str
58
+ Custom regex pattern for allowed origins.
59
+ allow_methods : list of str
60
+ Custom list of allowed HTTP methods.
61
+ allow_headers : list of str
62
+ Custom list of allowed headers.
63
+ expose_headers : list of str
64
+ Custom list of exposed headers.
65
+ allow_credentials : bool
66
+ Whether credentials are allowed.
67
+ max_age : int
68
+ Custom max age value.
47
69
  """
48
70
  cors = Cors(
49
71
  allow_origins=["https://example.com"],
@@ -64,58 +86,105 @@ class TestCorsConfig(TestCase):
64
86
 
65
87
  async def testInvalidAllowOriginsType(self):
66
88
  """
67
- Test that passing a string instead of a list to the 'allow_origins' parameter of the Cors class
89
+ Test type validation for 'allow_origins' parameter.
90
+
91
+ Ensures that passing a string instead of a list to the `allow_origins` parameter
68
92
  raises an OrionisIntegrityException.
93
+
94
+ Raises
95
+ ------
96
+ OrionisIntegrityException
97
+ If `allow_origins` is not a list.
69
98
  """
70
99
  with self.assertRaises(OrionisIntegrityException):
71
100
  Cors(allow_origins="*")
72
101
 
73
102
  async def testInvalidAllowOriginRegexType(self):
74
103
  """
75
- Test that passing a non-string, non-None value (specifically an integer) to the
76
- `allow_origin_regex` parameter of the `Cors` class raises an OrionisIntegrityException.
104
+ Test type validation for 'allow_origin_regex' parameter.
105
+
106
+ Ensures that passing a non-string, non-None value (e.g., integer) to the
107
+ `allow_origin_regex` parameter raises an OrionisIntegrityException.
108
+
109
+ Raises
110
+ ------
111
+ OrionisIntegrityException
112
+ If `allow_origin_regex` is not a string or None.
77
113
  """
78
114
  with self.assertRaises(OrionisIntegrityException):
79
115
  Cors(allow_origin_regex=123)
80
116
 
81
117
  async def testInvalidAllowMethodsType(self):
82
118
  """
83
- Test that initializing the Cors class with an invalid type for 'allow_methods' raises an OrionisIntegrityException.
119
+ Test type validation for 'allow_methods' parameter.
120
+
121
+ Ensures that passing a string instead of a list to the `allow_methods` parameter
122
+ raises an OrionisIntegrityException.
84
123
 
85
- This test verifies that passing a string instead of a list to the 'allow_methods' parameter
86
- of the Cors class triggers the expected exception, ensuring type validation is enforced.
124
+ Raises
125
+ ------
126
+ OrionisIntegrityException
127
+ If `allow_methods` is not a list.
87
128
  """
88
129
  with self.assertRaises(OrionisIntegrityException):
89
130
  Cors(allow_methods="GET")
90
131
 
91
132
  async def testInvalidAllowHeadersType(self):
92
133
  """
93
- Test that initializing the Cors class with a non-list type for 'allow_headers' (specifically a string)
94
- raises an OrionisIntegrityException, ensuring type validation for the 'allow_headers' parameter.
134
+ Test type validation for 'allow_headers' parameter.
135
+
136
+ Ensures that passing a string instead of a list to the `allow_headers` parameter
137
+ raises an OrionisIntegrityException.
138
+
139
+ Raises
140
+ ------
141
+ OrionisIntegrityException
142
+ If `allow_headers` is not a list.
95
143
  """
96
144
  with self.assertRaises(OrionisIntegrityException):
97
145
  Cors(allow_headers="Authorization")
98
146
 
99
147
  async def testInvalidExposeHeadersType(self):
100
148
  """
101
- Test that initializing the Cors class with a non-list type for 'expose_headers'
102
- raises an OrionisIntegrityException. Ensures type validation for the 'expose_headers' parameter.
149
+ Test type validation for 'expose_headers' parameter.
150
+
151
+ Ensures that passing a string instead of a list to the `expose_headers` parameter
152
+ raises an OrionisIntegrityException.
153
+
154
+ Raises
155
+ ------
156
+ OrionisIntegrityException
157
+ If `expose_headers` is not a list.
103
158
  """
104
159
  with self.assertRaises(OrionisIntegrityException):
105
160
  Cors(expose_headers="X-Custom-Header")
106
161
 
107
162
  async def testInvalidAllowCredentialsType(self):
108
163
  """
109
- Test that initializing the Cors class with a non-boolean value for 'allow_credentials'
110
- raises an OrionisIntegrityException, ensuring type validation for the parameter.
164
+ Test type validation for 'allow_credentials' parameter.
165
+
166
+ Ensures that passing a non-boolean value to the `allow_credentials` parameter
167
+ raises an OrionisIntegrityException.
168
+
169
+ Raises
170
+ ------
171
+ OrionisIntegrityException
172
+ If `allow_credentials` is not a boolean.
111
173
  """
112
174
  with self.assertRaises(OrionisIntegrityException):
113
175
  Cors(allow_credentials="yes")
114
176
 
115
177
  async def testInvalidMaxAgeType(self):
116
178
  """
117
- Test that passing a non-integer value (specifically a string) to the `max_age` parameter of the `Cors` class
118
- raises an `OrionisIntegrityException`. This ensures that `max_age` only accepts integer or None values.
179
+ Test type validation for 'max_age' parameter.
180
+
181
+ Ensures that passing a non-integer value (e.g., string) to the `max_age` parameter
182
+ raises an OrionisIntegrityException.
183
+
184
+ Raises
185
+ ------
186
+ OrionisIntegrityException
187
+ If `max_age` is not an integer or None.
119
188
  """
120
189
  with self.assertRaises(OrionisIntegrityException):
121
190
  Cors(max_age="3600")
@@ -6,12 +6,22 @@ from orionis.unittesting import TestCase
6
6
  class TestConfigDatabase(TestCase):
7
7
  """
8
8
  Test cases for the Database configuration class.
9
+
10
+ This class contains unit tests for the `Database` configuration class,
11
+ ensuring correct default values, validation, dictionary representation,
12
+ custom values, hashability, and keyword-only initialization.
13
+
14
+ Attributes
15
+ ----------
16
+ None
9
17
  """
10
18
 
11
19
  async def testDefaultValues(self):
12
20
  """
13
- Test that Database instance is created with correct default values.
14
- Verifies default connection is 'sqlite' and connections object is properly initialized.
21
+ Test creation of Database instance with default values.
22
+
23
+ Ensures that the default connection is set to 'sqlite' and the
24
+ connections attribute is properly initialized as a Connections instance.
15
25
  """
16
26
  db = Database()
17
27
  self.assertEqual(db.default, 'sqlite')
@@ -19,8 +29,11 @@ class TestConfigDatabase(TestCase):
19
29
 
20
30
  async def testDefaultConnectionValidation(self):
21
31
  """
22
- Test default connection attribute validation.
23
- Verifies that only valid connection types are accepted as default.
32
+ Validate the default connection attribute.
33
+
34
+ Checks that only valid connection types are accepted as default.
35
+ Also verifies that invalid, empty, or non-string defaults raise
36
+ OrionisIntegrityException.
24
37
  """
25
38
  # Test valid connection types
26
39
  valid_connections = ['sqlite', 'mysql', 'pgsql', 'oracle']
@@ -44,8 +57,11 @@ class TestConfigDatabase(TestCase):
44
57
 
45
58
  async def testConnectionsValidation(self):
46
59
  """
47
- Test connections attribute validation.
48
- Verifies that only Connections instances are accepted.
60
+ Validate the connections attribute.
61
+
62
+ Ensures that only instances of Connections are accepted for the
63
+ connections attribute. Invalid types or None should raise
64
+ OrionisIntegrityException.
49
65
  """
50
66
  # Test invalid connections type
51
67
  with self.assertRaises(OrionisIntegrityException):
@@ -63,8 +79,10 @@ class TestConfigDatabase(TestCase):
63
79
 
64
80
  async def testToDictMethod(self):
65
81
  """
66
- Test that toDict returns proper dictionary representation.
67
- Verifies all attributes are correctly included in dictionary.
82
+ Test the toDict method of Database.
83
+
84
+ Ensures that the toDict method returns a dictionary representation
85
+ of the Database instance, including all attributes.
68
86
  """
69
87
  db = Database()
70
88
  db_dict = db.toDict()
@@ -74,8 +92,10 @@ class TestConfigDatabase(TestCase):
74
92
 
75
93
  async def testCustomValues(self):
76
94
  """
77
- Test that custom values are properly stored and validated.
78
- Verifies custom configurations are correctly handled.
95
+ Test storage and validation of custom values.
96
+
97
+ Ensures that custom configurations for default and connections
98
+ are correctly handled and validated.
79
99
  """
80
100
  custom_connections = Connections()
81
101
  custom_db = Database(
@@ -87,8 +107,10 @@ class TestConfigDatabase(TestCase):
87
107
 
88
108
  async def testHashability(self):
89
109
  """
90
- Test that Database maintains hashability due to unsafe_hash=True.
91
- Verifies that Database instances can be used in sets and as dictionary keys.
110
+ Test hashability of Database instances.
111
+
112
+ Ensures that Database instances are hashable (due to unsafe_hash=True)
113
+ and can be used in sets and as dictionary keys.
92
114
  """
93
115
  db1 = Database()
94
116
  db2 = Database()
@@ -101,8 +123,10 @@ class TestConfigDatabase(TestCase):
101
123
 
102
124
  async def testKwOnlyInitialization(self):
103
125
  """
104
- Test that Database enforces keyword-only initialization.
105
- Verifies that positional arguments are not allowed for initialization.
126
+ Test keyword-only initialization enforcement.
127
+
128
+ Ensures that Database enforces keyword-only initialization and
129
+ raises TypeError when positional arguments are used.
106
130
  """
107
131
  with self.assertRaises(TypeError):
108
132
  Database('sqlite', Connections())