orionis 0.286.0__py3-none-any.whl → 0.288.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 (86) hide show
  1. orionis/metadata/framework.py +1 -1
  2. orionis/services/environment/contracts/env.py +45 -50
  3. orionis/services/environment/contracts/types.py +70 -0
  4. orionis/services/environment/dot_env.py +204 -182
  5. orionis/services/environment/env.py +68 -85
  6. orionis/services/{standard/exceptions/path_value_exceptions.py → environment/exceptions/environment_value_error.py} +2 -12
  7. orionis/services/environment/exceptions/environment_value_exception.py +23 -0
  8. orionis/services/environment/types.py +578 -0
  9. orionis/services/paths/exceptions/not_found_exceptions.py +15 -12
  10. orionis/services/paths/exceptions/path_value_exceptions.py +13 -10
  11. orionis/services/standard/contracts/std.py +1 -1
  12. orionis/services/standard/exceptions/std_value_exception.py +23 -0
  13. orionis/services/standard/std.py +2 -2
  14. orionis/services/system/contracts/imports.py +27 -7
  15. orionis/services/system/contracts/workers.py +8 -3
  16. orionis/services/system/imports.py +31 -12
  17. orionis/services/system/runtime_imports.py +33 -23
  18. orionis/services/system/workers.py +6 -8
  19. orionis/services/wrapper/dicts/dot_dict.py +82 -41
  20. orionis/test/logs/history.py +3 -5
  21. orionis/unittesting.py +12 -12
  22. {orionis-0.286.0.dist-info → orionis-0.288.0.dist-info}/METADATA +1 -1
  23. {orionis-0.286.0.dist-info → orionis-0.288.0.dist-info}/RECORD +76 -70
  24. tests/example/test_example.py +5 -2
  25. tests/foundation/config/app/{test_app.py → test_foundation_config_app.py} +14 -4
  26. tests/foundation/config/auth/{test_auth.py → test_foundation_config_auth.py} +10 -5
  27. tests/foundation/config/cache/{test_cache.py → test_foundation_config_cache.py} +61 -16
  28. tests/foundation/config/cache/test_foundation_config_cache_file.py +126 -0
  29. tests/foundation/config/cache/test_foundation_config_cache_stores.py +148 -0
  30. tests/foundation/config/cors/test_foundation_config_cors.py +190 -0
  31. tests/foundation/config/database/{test_database.py → test_foundation_config_database.py} +39 -15
  32. tests/foundation/config/database/{test_database_connections.py → test_foundation_config_database_connections.py} +80 -6
  33. tests/foundation/config/database/{test_database_mysql.py → test_foundation_config_database_mysql.py} +139 -16
  34. tests/foundation/config/database/{test_database_oracle.py → test_foundation_config_database_oracle.py} +111 -27
  35. tests/foundation/config/database/{test_database_pgsql.py → test_foundation_config_database_pgsql.py} +97 -27
  36. tests/foundation/config/database/{test_database_sqlite.py → test_foundation_config_database_sqlite.py} +57 -3
  37. tests/foundation/config/exceptions/{test_exceptions_integrity.py → test_foundation_config_exceptions.py} +45 -11
  38. tests/foundation/config/filesystems/{test_filesystems.py → test_foundation_config_filesystems.py} +65 -15
  39. tests/foundation/config/filesystems/{test_filesystems_aws.py → test_foundation_config_filesystems_aws.py} +46 -8
  40. tests/foundation/config/filesystems/{test_filesystems_disks.py → test_foundation_config_filesystems_disks.py} +79 -9
  41. tests/foundation/config/filesystems/{test_filesystems_local.py → test_foundation_config_filesystems_local.py} +67 -19
  42. tests/foundation/config/filesystems/{test_filesystems_public.py → test_foundation_config_filesystems_public.py} +38 -1
  43. tests/foundation/config/logging/test_foundation_config_logging.py +112 -0
  44. tests/foundation/config/logging/{test_logging_channels.py → test_foundation_config_logging_channels.py} +80 -3
  45. tests/foundation/config/logging/{test_logging_chunked.py → test_foundation_config_logging_chunked.py} +86 -13
  46. tests/foundation/config/logging/{test_logging_daily.py → test_foundation_config_logging_daily.py} +80 -13
  47. tests/foundation/config/logging/{test_logging_hourly.py → test_foundation_config_logging_hourly.py} +69 -3
  48. tests/foundation/config/logging/{test_logging_monthly.py → test_foundation_config_logging_monthly.py} +49 -3
  49. tests/foundation/config/logging/{test_logging_stack.py → test_foundation_config_logging_stack.py} +50 -15
  50. tests/foundation/config/logging/{test_logging_weekly.py → test_foundation_config_logging_weekly.py} +93 -3
  51. tests/foundation/config/mail/test_foundation_config_mail.py +145 -0
  52. tests/foundation/config/mail/{test_mail_file.py → test_foundation_config_mail_file.py} +41 -5
  53. tests/foundation/config/mail/test_foundation_config_mail_mailers.py +106 -0
  54. tests/foundation/config/mail/{test_mail_smtp.py → test_foundation_config_mail_smtp.py} +59 -15
  55. tests/foundation/config/queue/test_foundation_config_queue.py +111 -0
  56. tests/foundation/config/queue/{test_queue_brokers.py → test_foundation_config_queue_brokers.py} +28 -11
  57. tests/foundation/config/queue/{test_queue_database.py → test_foundation_config_queue_database.py} +54 -16
  58. tests/foundation/config/root/{test_root_paths.py → test_foundation_config_root_paths.py} +70 -3
  59. tests/foundation/config/session/{test_session.py → test_foundation_config_session.py} +31 -2
  60. tests/foundation/config/startup/{test_config_startup.py → test_foundation_config_startup.py} +91 -21
  61. tests/foundation/config/testing/{test_testing.py → test_foundation_config_testing.py} +69 -1
  62. tests/patterns/singleton/test_patterns_singleton.py +27 -0
  63. tests/services/asynchrony/{test_async_io.py → test_services_asynchrony_coroutine.py} +1 -1
  64. tests/services/environment/test_services_environment.py +93 -0
  65. tests/services/path/{test_resolver.py → test_services_resolver.py} +51 -12
  66. tests/services/standard/{test_std.py → test_services_std.py} +45 -22
  67. tests/services/system/__init__.py +0 -0
  68. tests/services/system/test_services_system_imports.py +101 -0
  69. tests/services/system/test_services_system_workers.py +89 -0
  70. tests/services/wrapper/{test_wrapper_doc_dict.py → test_services_wrapper_docdict.py} +28 -16
  71. tests/testing/test_testing_result.py +57 -20
  72. tests/testing/test_testing_unit.py +110 -41
  73. orionis/services/environment/exceptions/value_exception.py +0 -27
  74. tests/foundation/config/cache/test_cache_file.py +0 -78
  75. tests/foundation/config/cache/test_cache_stores.py +0 -88
  76. tests/foundation/config/cors/test_cors.py +0 -121
  77. tests/foundation/config/logging/test_logging.py +0 -48
  78. tests/foundation/config/mail/test_mail.py +0 -73
  79. tests/foundation/config/mail/test_mail_mailers.py +0 -58
  80. tests/foundation/config/queue/test_queue.py +0 -58
  81. tests/patterns/singleton/test_singleton.py +0 -18
  82. tests/services/environment/test_env.py +0 -155
  83. {orionis-0.286.0.dist-info → orionis-0.288.0.dist-info}/WHEEL +0 -0
  84. {orionis-0.286.0.dist-info → orionis-0.288.0.dist-info}/licenses/LICENCE +0 -0
  85. {orionis-0.286.0.dist-info → orionis-0.288.0.dist-info}/top_level.txt +0 -0
  86. {orionis-0.286.0.dist-info → orionis-0.288.0.dist-info}/zip-safe +0 -0
@@ -8,15 +8,49 @@ from orionis.foundation.config.logging.entities.chunked import Chunked
8
8
  from orionis.foundation.config.exceptions.integrity import OrionisIntegrityException
9
9
  from orionis.unittesting import TestCase
10
10
 
11
- class TestConfigChannels(TestCase):
11
+ class TestFoundationConfigLoggingChannels(TestCase):
12
12
  """
13
13
  Test cases for the Channels logging configuration class.
14
+
15
+ This class contains unit tests for the `Channels` class, ensuring correct
16
+ initialization, type validation, custom configuration, dictionary conversion,
17
+ hashability, and keyword-only initialization.
18
+
19
+ Attributes
20
+ ----------
21
+ None
22
+
23
+ Methods
24
+ -------
25
+ testDefaultValues()
26
+ Test that Channels instance is created with correct default values.
27
+ testStackValidation()
28
+ Test stack attribute type validation.
29
+ testHourlyValidation()
30
+ Test hourly attribute type validation.
31
+ testDailyValidation()
32
+ Test daily attribute type validation.
33
+ testWeeklyValidation()
34
+ Test weekly attribute type validation.
35
+ testMonthlyValidation()
36
+ Test monthly attribute type validation.
37
+ testChunkedValidation()
38
+ Test chunked attribute type validation.
39
+ testCustomConfigurations()
40
+ Test that custom channel configurations are properly stored and validated.
41
+ testToDictMethod()
42
+ Test that toDict returns proper dictionary representation.
43
+ testHashability()
44
+ Test that Channels maintains hashability due to unsafe_hash=True.
45
+ testKwOnlyInitialization()
46
+ Test that Channels enforces keyword-only initialization.
14
47
  """
15
48
 
16
49
  async def testDefaultValues(self):
17
50
  """
18
51
  Test that Channels instance is created with correct default values.
19
- Verifies all channel configurations are properly initialized with their default values.
52
+
53
+ Ensures all channel configurations are properly initialized with their default values.
20
54
  """
21
55
  channels = Channels()
22
56
  self.assertIsInstance(channels.stack, Stack)
@@ -29,7 +63,13 @@ class TestConfigChannels(TestCase):
29
63
  async def testStackValidation(self):
30
64
  """
31
65
  Test stack attribute type validation.
32
- Verifies that only Stack instances are accepted for stack attribute.
66
+
67
+ Verifies that only Stack instances are accepted for the stack attribute.
68
+
69
+ Raises
70
+ ------
71
+ OrionisIntegrityException
72
+ If the stack attribute is not a Stack instance.
33
73
  """
34
74
  with self.assertRaises(OrionisIntegrityException):
35
75
  Channels(stack="not_a_stack_instance")
@@ -43,6 +83,11 @@ class TestConfigChannels(TestCase):
43
83
  async def testHourlyValidation(self):
44
84
  """
45
85
  Test hourly attribute type validation.
86
+
87
+ Raises
88
+ ------
89
+ OrionisIntegrityException
90
+ If the hourly attribute is not an Hourly instance.
46
91
  """
47
92
  with self.assertRaises(OrionisIntegrityException):
48
93
  Channels(hourly="not_an_hourly_instance")
@@ -54,6 +99,11 @@ class TestConfigChannels(TestCase):
54
99
  async def testDailyValidation(self):
55
100
  """
56
101
  Test daily attribute type validation.
102
+
103
+ Raises
104
+ ------
105
+ OrionisIntegrityException
106
+ If the daily attribute is not a Daily instance.
57
107
  """
58
108
  with self.assertRaises(OrionisIntegrityException):
59
109
  Channels(daily="not_a_daily_instance")
@@ -65,6 +115,11 @@ class TestConfigChannels(TestCase):
65
115
  async def testWeeklyValidation(self):
66
116
  """
67
117
  Test weekly attribute type validation.
118
+
119
+ Raises
120
+ ------
121
+ OrionisIntegrityException
122
+ If the weekly attribute is not a Weekly instance.
68
123
  """
69
124
  with self.assertRaises(OrionisIntegrityException):
70
125
  Channels(weekly="not_a_weekly_instance")
@@ -76,6 +131,11 @@ class TestConfigChannels(TestCase):
76
131
  async def testMonthlyValidation(self):
77
132
  """
78
133
  Test monthly attribute type validation.
134
+
135
+ Raises
136
+ ------
137
+ OrionisIntegrityException
138
+ If the monthly attribute is not a Monthly instance.
79
139
  """
80
140
  with self.assertRaises(OrionisIntegrityException):
81
141
  Channels(monthly="not_a_monthly_instance")
@@ -87,6 +147,11 @@ class TestConfigChannels(TestCase):
87
147
  async def testChunkedValidation(self):
88
148
  """
89
149
  Test chunked attribute type validation.
150
+
151
+ Raises
152
+ ------
153
+ OrionisIntegrityException
154
+ If the chunked attribute is not a Chunked instance.
90
155
  """
91
156
  with self.assertRaises(OrionisIntegrityException):
92
157
  Channels(chunked="not_a_chunked_instance")
@@ -98,6 +163,9 @@ class TestConfigChannels(TestCase):
98
163
  async def testCustomConfigurations(self):
99
164
  """
100
165
  Test that custom channel configurations are properly stored and validated.
166
+
167
+ Ensures that custom channel instances are correctly assigned and their
168
+ properties are properly set.
101
169
  """
102
170
  custom_stack = Stack(path="custom/stack.log")
103
171
  custom_hourly = Hourly(path="custom/hourly.log")
@@ -124,6 +192,8 @@ class TestConfigChannels(TestCase):
124
192
  async def testToDictMethod(self):
125
193
  """
126
194
  Test that toDict returns proper dictionary representation.
195
+
196
+ Ensures that the `toDict` method returns a dictionary with the correct structure.
127
197
  """
128
198
  channels = Channels()
129
199
  channels_dict = channels.toDict()
@@ -138,6 +208,8 @@ class TestConfigChannels(TestCase):
138
208
  async def testHashability(self):
139
209
  """
140
210
  Test that Channels maintains hashability due to unsafe_hash=True.
211
+
212
+ Ensures that Channels instances can be used in sets and as dictionary keys.
141
213
  """
142
214
  channels1 = Channels()
143
215
  channels2 = Channels()
@@ -152,6 +224,11 @@ class TestConfigChannels(TestCase):
152
224
  async def testKwOnlyInitialization(self):
153
225
  """
154
226
  Test that Channels enforces keyword-only initialization.
227
+
228
+ Raises
229
+ ------
230
+ TypeError
231
+ If positional arguments are used instead of keyword arguments.
155
232
  """
156
233
  with self.assertRaises(TypeError):
157
234
  Channels(Stack(), Hourly(), Daily(), Weekly(), Monthly(), Chunked())
@@ -3,15 +3,26 @@ from orionis.foundation.config.logging.enums.levels import Level
3
3
  from orionis.foundation.config.exceptions.integrity import OrionisIntegrityException
4
4
  from orionis.unittesting import TestCase
5
5
 
6
- class TestConfigChunked(TestCase):
6
+ class TestFoundationConfigLoggingChunked(TestCase):
7
7
  """
8
8
  Test cases for the Chunked logging configuration class.
9
+
10
+ Notes
11
+ -----
12
+ These tests validate the integrity, default values, and behavior of the
13
+ `Chunked` logging configuration entity, including its attributes and methods.
9
14
  """
10
15
 
11
16
  async def testDefaultValues(self):
12
17
  """
13
- Test that Chunked instance is created with correct default values.
14
- Verifies default path, level, mb_size and files match expected values.
18
+ Test default values of Chunked instance.
19
+
20
+ Ensures that a `Chunked` instance is created with the correct default values
21
+ for `path`, `level`, `mb_size`, and `files`.
22
+
23
+ Returns
24
+ -------
25
+ None
15
26
  """
16
27
  chunked = Chunked()
17
28
  self.assertEqual(chunked.path, "storage/log/application.log")
@@ -21,8 +32,14 @@ class TestConfigChunked(TestCase):
21
32
 
22
33
  async def testPathValidation(self):
23
34
  """
24
- Test path attribute validation.
25
- Verifies that empty or non-string paths raise exceptions.
35
+ Test validation of the `path` attribute.
36
+
37
+ Verifies that empty or non-string paths raise `OrionisIntegrityException`.
38
+ Also checks that a valid path does not raise an exception.
39
+
40
+ Returns
41
+ -------
42
+ None
26
43
  """
27
44
  with self.assertRaises(OrionisIntegrityException):
28
45
  Chunked(path="")
@@ -35,7 +52,14 @@ class TestConfigChunked(TestCase):
35
52
 
36
53
  async def testLevelValidation(self):
37
54
  """
38
- Test level attribute validation with different input types.
55
+ Test validation of the `level` attribute.
56
+
57
+ Checks that the `level` can be set using a string, integer, or enum,
58
+ and that invalid values raise `OrionisIntegrityException`.
59
+
60
+ Returns
61
+ -------
62
+ None
39
63
  """
40
64
  # Test string level
41
65
  chunked = Chunked(level="debug")
@@ -59,7 +83,14 @@ class TestConfigChunked(TestCase):
59
83
 
60
84
  async def testMbSizeValidation(self):
61
85
  """
62
- Test mb_size attribute validation with different input formats.
86
+ Test validation of the `mb_size` attribute.
87
+
88
+ Ensures that valid integer and string formats are accepted, and invalid
89
+ values raise `OrionisIntegrityException`.
90
+
91
+ Returns
92
+ -------
93
+ None
63
94
  """
64
95
  # Test valid integer values
65
96
  try:
@@ -90,7 +121,14 @@ class TestConfigChunked(TestCase):
90
121
 
91
122
  async def testFilesValidation(self):
92
123
  """
93
- Test files attribute validation.
124
+ Test validation of the `files` attribute.
125
+
126
+ Ensures that valid integer values are accepted, and invalid values raise
127
+ `OrionisIntegrityException`.
128
+
129
+ Returns
130
+ -------
131
+ None
94
132
  """
95
133
  # Test valid values
96
134
  try:
@@ -109,7 +147,14 @@ class TestConfigChunked(TestCase):
109
147
 
110
148
  async def testWhitespaceHandling(self):
111
149
  """
112
- Test whitespace handling in path and level attributes.
150
+ Test handling of whitespace in `path` and `level` attributes.
151
+
152
+ Ensures that leading and trailing whitespace in `path` and `level` are
153
+ handled as expected.
154
+
155
+ Returns
156
+ -------
157
+ None
113
158
  """
114
159
  chunked = Chunked(path=" logs/app.log ", level=" debug ")
115
160
  self.assertEqual(chunked.path, " logs/app.log ")
@@ -117,7 +162,14 @@ class TestConfigChunked(TestCase):
117
162
 
118
163
  async def testToDictMethod(self):
119
164
  """
120
- Test that toDict returns proper dictionary representation.
165
+ Test the `toDict` method.
166
+
167
+ Ensures that `toDict` returns a dictionary representation of the instance
168
+ with correct values.
169
+
170
+ Returns
171
+ -------
172
+ None
121
173
  """
122
174
  chunked = Chunked()
123
175
  chunked_dict = chunked.toDict()
@@ -130,7 +182,14 @@ class TestConfigChunked(TestCase):
130
182
 
131
183
  async def testCustomValuesToDict(self):
132
184
  """
133
- Test that custom values are properly included in dictionary.
185
+ Test `toDict` with custom values.
186
+
187
+ Ensures that custom values provided to the constructor are correctly
188
+ reflected in the dictionary representation.
189
+
190
+ Returns
191
+ -------
192
+ None
134
193
  """
135
194
  custom_chunked = Chunked(
136
195
  path="custom/logs/app.log",
@@ -146,7 +205,14 @@ class TestConfigChunked(TestCase):
146
205
 
147
206
  async def testHashability(self):
148
207
  """
149
- Test that Chunked maintains hashability due to unsafe_hash=True.
208
+ Test hashability of Chunked instances.
209
+
210
+ Ensures that `Chunked` instances are hashable and can be used in sets,
211
+ due to `unsafe_hash=True`.
212
+
213
+ Returns
214
+ -------
215
+ None
150
216
  """
151
217
  chunked1 = Chunked()
152
218
  chunked2 = Chunked()
@@ -160,7 +226,14 @@ class TestConfigChunked(TestCase):
160
226
 
161
227
  async def testKwOnlyInitialization(self):
162
228
  """
163
- Test that Chunked enforces keyword-only initialization.
229
+ Test enforcement of keyword-only initialization.
230
+
231
+ Ensures that `Chunked` cannot be initialized with positional arguments,
232
+ and raises a `TypeError` if attempted.
233
+
234
+ Returns
235
+ -------
236
+ None
164
237
  """
165
238
  with self.assertRaises(TypeError):
166
239
  Chunked("path.log", "info", 10, 5)
@@ -4,15 +4,25 @@ from orionis.foundation.config.logging.enums.levels import Level
4
4
  from orionis.foundation.config.exceptions.integrity import OrionisIntegrityException
5
5
  from orionis.unittesting import TestCase
6
6
 
7
- class TestConfigDaily(TestCase):
7
+ class TestFoundationConfigLoggingDaily(TestCase):
8
8
  """
9
9
  Test cases for the Daily logging configuration class.
10
+
11
+ This class contains unit tests for the `Daily` logging configuration entity,
12
+ validating its default values, attribute validation, dictionary conversion,
13
+ hashability, and keyword-only initialization.
10
14
  """
11
15
 
12
16
  async def testDefaultValues(self):
13
17
  """
14
- Test that Daily instance is created with correct default values.
15
- Verifies default path, level, retention_days and at time match expected values.
18
+ Test creation of Daily instance with default values.
19
+
20
+ Ensures that the default path, level, retention_days, and at time
21
+ are set as expected.
22
+
23
+ Returns
24
+ -------
25
+ None
16
26
  """
17
27
  daily = Daily()
18
28
  self.assertEqual(daily.path, "storage/log/application.log")
@@ -22,8 +32,14 @@ class TestConfigDaily(TestCase):
22
32
 
23
33
  async def testPathValidation(self):
24
34
  """
25
- Test path attribute validation.
26
- Verifies that empty or non-string paths raise exceptions.
35
+ Test validation of the path attribute.
36
+
37
+ Verifies that empty or non-string paths raise exceptions, and that
38
+ valid paths are accepted.
39
+
40
+ Returns
41
+ -------
42
+ None
27
43
  """
28
44
  with self.assertRaises(OrionisIntegrityException):
29
45
  Daily(path="")
@@ -36,7 +52,14 @@ class TestConfigDaily(TestCase):
36
52
 
37
53
  async def testLevelValidation(self):
38
54
  """
39
- Test level attribute validation with different input types.
55
+ Test validation of the level attribute.
56
+
57
+ Checks that string, integer, and enum values are accepted for level,
58
+ and that invalid values raise exceptions.
59
+
60
+ Returns
61
+ -------
62
+ None
40
63
  """
41
64
  # Test string level
42
65
  daily = Daily(level="debug")
@@ -60,7 +83,13 @@ class TestConfigDaily(TestCase):
60
83
 
61
84
  async def testRetentionDaysValidation(self):
62
85
  """
63
- Test retention_days attribute validation.
86
+ Test validation of the retention_days attribute.
87
+
88
+ Ensures that valid values are accepted and invalid values raise exceptions.
89
+
90
+ Returns
91
+ -------
92
+ None
64
93
  """
65
94
  # Test valid values
66
95
  try:
@@ -82,7 +111,14 @@ class TestConfigDaily(TestCase):
82
111
 
83
112
  async def testAtTimeValidation(self):
84
113
  """
85
- Test at time attribute validation and conversion.
114
+ Test validation and conversion of the at attribute.
115
+
116
+ Checks that a `datetime.time` object is properly converted and that
117
+ invalid types raise exceptions.
118
+
119
+ Returns
120
+ -------
121
+ None
86
122
  """
87
123
  # Test time object
88
124
  daily = Daily(at=time(12, 30))
@@ -96,7 +132,13 @@ class TestConfigDaily(TestCase):
96
132
 
97
133
  async def testWhitespaceHandling(self):
98
134
  """
99
- Test whitespace handling in path and level attributes.
135
+ Test handling of whitespace in path and level attributes.
136
+
137
+ Ensures that whitespace in path and level is preserved or handled as expected.
138
+
139
+ Returns
140
+ -------
141
+ None
100
142
  """
101
143
  daily = Daily(path=" logs/app.log ", level=" debug ")
102
144
  self.assertEqual(daily.path, " logs/app.log ")
@@ -104,7 +146,14 @@ class TestConfigDaily(TestCase):
104
146
 
105
147
  async def testToDictMethod(self):
106
148
  """
107
- Test that toDict returns proper dictionary representation.
149
+ Test the toDict method for correct dictionary representation.
150
+
151
+ Ensures that the dictionary returned by toDict contains the correct
152
+ default values.
153
+
154
+ Returns
155
+ -------
156
+ None
108
157
  """
109
158
  daily = Daily()
110
159
  daily_dict = daily.toDict()
@@ -117,7 +166,13 @@ class TestConfigDaily(TestCase):
117
166
 
118
167
  async def testCustomValuesToDict(self):
119
168
  """
120
- Test that custom values are properly included in dictionary.
169
+ Test toDict method with custom values.
170
+
171
+ Ensures that custom values are correctly represented in the dictionary.
172
+
173
+ Returns
174
+ -------
175
+ None
121
176
  """
122
177
  custom_daily = Daily(
123
178
  path="custom/logs/app.log",
@@ -133,7 +188,13 @@ class TestConfigDaily(TestCase):
133
188
 
134
189
  async def testHashability(self):
135
190
  """
136
- Test that Daily maintains hashability due to unsafe_hash=True.
191
+ Test hashability of Daily instances.
192
+
193
+ Ensures that Daily instances are hashable and can be used in sets.
194
+
195
+ Returns
196
+ -------
197
+ None
137
198
  """
138
199
  daily1 = Daily()
139
200
  daily2 = Daily()
@@ -147,7 +208,13 @@ class TestConfigDaily(TestCase):
147
208
 
148
209
  async def testKwOnlyInitialization(self):
149
210
  """
150
- Test that Daily enforces keyword-only initialization.
211
+ Test enforcement of keyword-only initialization.
212
+
213
+ Ensures that positional arguments raise a TypeError.
214
+
215
+ Returns
216
+ -------
217
+ None
151
218
  """
152
219
  with self.assertRaises(TypeError):
153
220
  Daily("path.log", "info", 7, time(0, 0))
@@ -3,15 +3,25 @@ from orionis.foundation.config.logging.enums.levels import Level
3
3
  from orionis.foundation.config.exceptions.integrity import OrionisIntegrityException
4
4
  from orionis.unittesting import TestCase
5
5
 
6
- class TestConfigHourly(TestCase):
6
+ class TestFoundationConfigLoggingHourly(TestCase):
7
7
  """
8
8
  Test cases for the Hourly logging configuration class.
9
+
10
+ This class contains unit tests for the `Hourly` logging configuration entity,
11
+ verifying its default values, attribute validation, dictionary representation,
12
+ hashability, and keyword-only initialization enforcement.
9
13
  """
10
14
 
11
15
  async def testDefaultValues(self):
12
16
  """
13
17
  Test that Hourly instance is created with correct default values.
14
- Verifies default path, level and retention_hours match expected values.
18
+
19
+ Verifies that the default `path`, `level`, and `retention_hours` attributes
20
+ of the Hourly instance match the expected values.
21
+
22
+ Returns
23
+ -------
24
+ None
15
25
  """
16
26
  hourly = Hourly()
17
27
  self.assertEqual(hourly.path, "storage/log/application.log")
@@ -21,7 +31,14 @@ class TestConfigHourly(TestCase):
21
31
  async def testPathValidation(self):
22
32
  """
23
33
  Test path attribute validation.
24
- Verifies that empty or non-string paths raise exceptions.
34
+
35
+ Ensures that invalid values for the `path` attribute, such as empty strings
36
+ or non-string types, raise an `OrionisIntegrityException`. Also verifies that
37
+ valid paths do not raise exceptions.
38
+
39
+ Returns
40
+ -------
41
+ None
25
42
  """
26
43
  with self.assertRaises(OrionisIntegrityException):
27
44
  Hourly(path="")
@@ -35,6 +52,13 @@ class TestConfigHourly(TestCase):
35
52
  async def testLevelValidation(self):
36
53
  """
37
54
  Test level attribute validation with different input types.
55
+
56
+ Checks that the `level` attribute accepts string, integer, and enum values,
57
+ and that invalid values raise an `OrionisIntegrityException`.
58
+
59
+ Returns
60
+ -------
61
+ None
38
62
  """
39
63
  # Test string level
40
64
  hourly = Hourly(level="debug")
@@ -59,6 +83,13 @@ class TestConfigHourly(TestCase):
59
83
  async def testRetentionHoursValidation(self):
60
84
  """
61
85
  Test retention_hours attribute validation.
86
+
87
+ Ensures that valid values for `retention_hours` are accepted and invalid
88
+ values raise an `OrionisIntegrityException`.
89
+
90
+ Returns
91
+ -------
92
+ None
62
93
  """
63
94
  # Test valid values
64
95
  try:
@@ -81,6 +112,13 @@ class TestConfigHourly(TestCase):
81
112
  async def testWhitespaceHandling(self):
82
113
  """
83
114
  Test whitespace handling in path and level attributes.
115
+
116
+ Verifies that leading and trailing whitespace in the `path` and `level`
117
+ attributes are handled as expected.
118
+
119
+ Returns
120
+ -------
121
+ None
84
122
  """
85
123
  hourly = Hourly(path=" logs/app.log ", level=" debug ")
86
124
  self.assertEqual(hourly.path, " logs/app.log ")
@@ -89,6 +127,13 @@ class TestConfigHourly(TestCase):
89
127
  async def testToDictMethod(self):
90
128
  """
91
129
  Test that toDict returns proper dictionary representation.
130
+
131
+ Ensures that the `toDict` method returns a dictionary with the correct
132
+ attribute values.
133
+
134
+ Returns
135
+ -------
136
+ None
92
137
  """
93
138
  hourly = Hourly()
94
139
  hourly_dict = hourly.toDict()
@@ -100,6 +145,13 @@ class TestConfigHourly(TestCase):
100
145
  async def testCustomValuesToDict(self):
101
146
  """
102
147
  Test that custom values are properly included in dictionary.
148
+
149
+ Verifies that custom values provided to the Hourly instance are correctly
150
+ reflected in the dictionary returned by `toDict`.
151
+
152
+ Returns
153
+ -------
154
+ None
103
155
  """
104
156
  custom_hourly = Hourly(
105
157
  path="custom/logs/app.log",
@@ -114,6 +166,13 @@ class TestConfigHourly(TestCase):
114
166
  async def testHashability(self):
115
167
  """
116
168
  Test that Hourly maintains hashability due to unsafe_hash=True.
169
+
170
+ Ensures that Hourly instances can be added to a set and that their
171
+ hashability is preserved.
172
+
173
+ Returns
174
+ -------
175
+ None
117
176
  """
118
177
  hourly1 = Hourly()
119
178
  hourly2 = Hourly()
@@ -126,6 +185,13 @@ class TestConfigHourly(TestCase):
126
185
  async def testKwOnlyInitialization(self):
127
186
  """
128
187
  Test that Hourly enforces keyword-only initialization.
188
+
189
+ Verifies that attempting to initialize Hourly with positional arguments
190
+ raises a TypeError.
191
+
192
+ Returns
193
+ -------
194
+ None
129
195
  """
130
196
  with self.assertRaises(TypeError):
131
197
  Hourly("path.log", "info", 24)