orionis 0.437.0__py3-none-any.whl → 0.438.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.
- orionis/metadata/framework.py +1 -1
- {orionis-0.437.0.dist-info → orionis-0.438.0.dist-info}/METADATA +1 -1
- {orionis-0.437.0.dist-info → orionis-0.438.0.dist-info}/RECORD +25 -24
- tests/container/core/__init__.py +0 -0
- tests/container/mocks/mock_complex_classes.py +502 -192
- tests/container/mocks/mock_simple_classes.py +72 -6
- tests/container/validators/test_is_valid_alias.py +1 -1
- tests/foundation/config/database/test_foundation_config_database.py +54 -28
- tests/foundation/config/filesystems/test_foundation_config_filesystems_aws.py +40 -22
- tests/foundation/config/filesystems/test_foundation_config_filesystems_public.py +75 -48
- tests/foundation/config/logging/test_foundation_config_logging_channels.py +49 -37
- tests/foundation/config/logging/test_foundation_config_logging_monthly.py +80 -42
- tests/foundation/config/logging/test_foundation_config_logging_stack.py +46 -22
- tests/foundation/config/root/test_foundation_config_root_paths.py +37 -44
- tests/foundation/config/session/test_foundation_config_session.py +65 -20
- tests/foundation/config/startup/test_foundation_config_startup.py +37 -33
- tests/services/introspection/dependencies/test_reflect_dependencies.py +77 -25
- tests/services/introspection/reflection/test_reflection_abstract.py +403 -47
- {orionis-0.437.0.dist-info → orionis-0.438.0.dist-info}/WHEEL +0 -0
- {orionis-0.437.0.dist-info → orionis-0.438.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.437.0.dist-info → orionis-0.438.0.dist-info}/top_level.txt +0 -0
- {orionis-0.437.0.dist-info → orionis-0.438.0.dist-info}/zip-safe +0 -0
- /tests/container/{test_container.py → core/test_container.py} +0 -0
- /tests/container/{test_singleton.py → core/test_singleton.py} +0 -0
- /tests/container/{test_thread_safety.py → core/test_thread_safety.py} +0 -0
|
@@ -2,31 +2,97 @@ from abc import ABC, abstractmethod
|
|
|
2
2
|
|
|
3
3
|
class ICar(ABC):
|
|
4
4
|
"""
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Interface for car objects.
|
|
6
|
+
|
|
7
|
+
Defines the required methods for car objects, including starting and stopping the car.
|
|
8
|
+
|
|
9
|
+
Methods
|
|
10
|
+
-------
|
|
11
|
+
start() -> str
|
|
12
|
+
Start the car and return a message indicating the car has started.
|
|
13
|
+
stop() -> str
|
|
14
|
+
Stop the car and return a message indicating the car has stopped.
|
|
7
15
|
"""
|
|
8
16
|
|
|
9
17
|
@abstractmethod
|
|
10
18
|
def start(self) -> str:
|
|
11
19
|
"""
|
|
12
|
-
|
|
20
|
+
Start the car.
|
|
21
|
+
|
|
22
|
+
Returns
|
|
23
|
+
-------
|
|
24
|
+
str
|
|
25
|
+
Message indicating the car has started.
|
|
13
26
|
"""
|
|
14
27
|
pass
|
|
15
28
|
|
|
16
29
|
@abstractmethod
|
|
17
30
|
def stop(self) -> str:
|
|
18
31
|
"""
|
|
19
|
-
|
|
32
|
+
Stop the car.
|
|
33
|
+
|
|
34
|
+
Returns
|
|
35
|
+
-------
|
|
36
|
+
str
|
|
37
|
+
Message indicating the car has stopped.
|
|
20
38
|
"""
|
|
21
39
|
pass
|
|
22
40
|
|
|
23
41
|
class Car(ICar):
|
|
42
|
+
"""
|
|
43
|
+
Concrete implementation of the ICar interface.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
brand : str, optional
|
|
48
|
+
The brand of the car (default is 'a').
|
|
49
|
+
model : str, optional
|
|
50
|
+
The model of the car (default is 'b').
|
|
51
|
+
|
|
52
|
+
Attributes
|
|
53
|
+
----------
|
|
54
|
+
brand : str
|
|
55
|
+
The brand of the car.
|
|
56
|
+
model : str
|
|
57
|
+
The model of the car.
|
|
58
|
+
"""
|
|
59
|
+
|
|
24
60
|
def __init__(self, brand: str = 'a', model: str = 'b'):
|
|
25
|
-
|
|
26
|
-
|
|
61
|
+
"""
|
|
62
|
+
Initialize a new Car instance with the specified brand and model.
|
|
63
|
+
|
|
64
|
+
Parameters
|
|
65
|
+
----------
|
|
66
|
+
brand : str, optional
|
|
67
|
+
The brand of the car. Default is 'a'.
|
|
68
|
+
model : str, optional
|
|
69
|
+
The model of the car. Default is 'b'.
|
|
70
|
+
|
|
71
|
+
Notes
|
|
72
|
+
-----
|
|
73
|
+
This constructor sets the brand and model attributes for the Car object.
|
|
74
|
+
"""
|
|
75
|
+
self.brand = brand # Set the brand of the car
|
|
76
|
+
self.model = model # Set the model of the car
|
|
27
77
|
|
|
28
78
|
def start(self):
|
|
79
|
+
"""
|
|
80
|
+
Start the car.
|
|
81
|
+
|
|
82
|
+
Returns
|
|
83
|
+
-------
|
|
84
|
+
str
|
|
85
|
+
Message indicating the car is starting.
|
|
86
|
+
"""
|
|
29
87
|
return f"{self.brand} {self.model} is starting."
|
|
30
88
|
|
|
31
89
|
def stop(self):
|
|
90
|
+
"""
|
|
91
|
+
Stop the car.
|
|
92
|
+
|
|
93
|
+
Returns
|
|
94
|
+
-------
|
|
95
|
+
str
|
|
96
|
+
Message indicating the car is stopping.
|
|
97
|
+
"""
|
|
32
98
|
return f"{self.brand} {self.model} is stopping."
|
|
@@ -80,7 +80,7 @@ class TestIsValidAlias(AsyncTestCase):
|
|
|
80
80
|
This method does not return any value. It passes if the expected exception and message are raised.
|
|
81
81
|
"""
|
|
82
82
|
invalid_aliases = [
|
|
83
|
-
"invalid alias",
|
|
83
|
+
"invalid alias", # space
|
|
84
84
|
"invalid\talias", # tab
|
|
85
85
|
"invalid\nalias", # newline
|
|
86
86
|
"invalid@alias", # special character
|
|
@@ -5,23 +5,24 @@ from orionis.test.cases.asynchronous import AsyncTestCase
|
|
|
5
5
|
|
|
6
6
|
class TestFoundationConfigDatabase(AsyncTestCase):
|
|
7
7
|
"""
|
|
8
|
-
|
|
8
|
+
Unit tests for the Database configuration class.
|
|
9
9
|
|
|
10
|
-
This class
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Attributes
|
|
15
|
-
----------
|
|
16
|
-
None
|
|
10
|
+
This class provides asynchronous test cases to verify the behavior,
|
|
11
|
+
validation, and integrity of the `Database` configuration class,
|
|
12
|
+
including default values, attribute validation, dictionary conversion,
|
|
13
|
+
custom values, hashability, and keyword-only initialization enforcement.
|
|
17
14
|
"""
|
|
18
15
|
|
|
19
16
|
async def testDefaultValues(self):
|
|
20
17
|
"""
|
|
21
|
-
Test
|
|
18
|
+
Test that a Database instance initializes with correct default values.
|
|
19
|
+
|
|
20
|
+
Ensures that the `default` attribute is set to 'sqlite' and the
|
|
21
|
+
`connections` attribute is an instance of Connections.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Returns
|
|
24
|
+
-------
|
|
25
|
+
None
|
|
25
26
|
"""
|
|
26
27
|
db = Database()
|
|
27
28
|
self.assertEqual(db.default, 'sqlite')
|
|
@@ -29,11 +30,15 @@ class TestFoundationConfigDatabase(AsyncTestCase):
|
|
|
29
30
|
|
|
30
31
|
async def testDefaultConnectionValidation(self):
|
|
31
32
|
"""
|
|
32
|
-
Validate the default connection attribute.
|
|
33
|
+
Validate the `default` connection attribute for allowed values.
|
|
33
34
|
|
|
34
|
-
Checks that only valid connection types are accepted
|
|
35
|
-
|
|
35
|
+
Checks that only valid connection types are accepted for the `default`
|
|
36
|
+
attribute. Verifies that invalid, empty, or non-string values raise
|
|
36
37
|
OrionisIntegrityException.
|
|
38
|
+
|
|
39
|
+
Returns
|
|
40
|
+
-------
|
|
41
|
+
None
|
|
37
42
|
"""
|
|
38
43
|
# Test valid connection types
|
|
39
44
|
valid_connections = ['sqlite', 'mysql', 'pgsql', 'oracle']
|
|
@@ -57,11 +62,15 @@ class TestFoundationConfigDatabase(AsyncTestCase):
|
|
|
57
62
|
|
|
58
63
|
async def testConnectionsValidation(self):
|
|
59
64
|
"""
|
|
60
|
-
Validate the connections attribute.
|
|
65
|
+
Validate the `connections` attribute for correct type.
|
|
61
66
|
|
|
62
67
|
Ensures that only instances of Connections are accepted for the
|
|
63
|
-
connections attribute. Invalid types or None should raise
|
|
68
|
+
`connections` attribute. Invalid types or None should raise
|
|
64
69
|
OrionisIntegrityException.
|
|
70
|
+
|
|
71
|
+
Returns
|
|
72
|
+
-------
|
|
73
|
+
None
|
|
65
74
|
"""
|
|
66
75
|
# Test invalid connections type
|
|
67
76
|
with self.assertRaises(OrionisIntegrityException):
|
|
@@ -79,10 +88,15 @@ class TestFoundationConfigDatabase(AsyncTestCase):
|
|
|
79
88
|
|
|
80
89
|
async def testToDictMethod(self):
|
|
81
90
|
"""
|
|
82
|
-
Test the toDict method
|
|
91
|
+
Test the `toDict` method for dictionary representation.
|
|
83
92
|
|
|
84
|
-
Ensures that the toDict method returns a dictionary
|
|
85
|
-
of the Database instance, including
|
|
93
|
+
Ensures that the `toDict` method returns a dictionary containing
|
|
94
|
+
all attributes of the Database instance, including `default` and
|
|
95
|
+
`connections`.
|
|
96
|
+
|
|
97
|
+
Returns
|
|
98
|
+
-------
|
|
99
|
+
None
|
|
86
100
|
"""
|
|
87
101
|
db = Database()
|
|
88
102
|
db_dict = db.toDict()
|
|
@@ -92,10 +106,14 @@ class TestFoundationConfigDatabase(AsyncTestCase):
|
|
|
92
106
|
|
|
93
107
|
async def testCustomValues(self):
|
|
94
108
|
"""
|
|
95
|
-
Test
|
|
109
|
+
Test handling and validation of custom attribute values.
|
|
110
|
+
|
|
111
|
+
Ensures that custom values for `default` and `connections` are
|
|
112
|
+
correctly stored and validated in the Database instance.
|
|
96
113
|
|
|
97
|
-
|
|
98
|
-
|
|
114
|
+
Returns
|
|
115
|
+
-------
|
|
116
|
+
None
|
|
99
117
|
"""
|
|
100
118
|
custom_connections = Connections()
|
|
101
119
|
custom_db = Database(
|
|
@@ -107,10 +125,14 @@ class TestFoundationConfigDatabase(AsyncTestCase):
|
|
|
107
125
|
|
|
108
126
|
async def testHashability(self):
|
|
109
127
|
"""
|
|
110
|
-
Test
|
|
128
|
+
Test that Database instances are hashable.
|
|
111
129
|
|
|
112
|
-
|
|
113
|
-
and
|
|
130
|
+
Verifies that Database instances can be used in sets and as dictionary
|
|
131
|
+
keys, and that identical instances are considered equal.
|
|
132
|
+
|
|
133
|
+
Returns
|
|
134
|
+
-------
|
|
135
|
+
None
|
|
114
136
|
"""
|
|
115
137
|
db1 = Database()
|
|
116
138
|
db2 = Database()
|
|
@@ -123,10 +145,14 @@ class TestFoundationConfigDatabase(AsyncTestCase):
|
|
|
123
145
|
|
|
124
146
|
async def testKwOnlyInitialization(self):
|
|
125
147
|
"""
|
|
126
|
-
Test keyword-only initialization
|
|
148
|
+
Test enforcement of keyword-only initialization.
|
|
149
|
+
|
|
150
|
+
Ensures that Database raises TypeError when positional arguments are
|
|
151
|
+
used instead of keyword arguments during initialization.
|
|
127
152
|
|
|
128
|
-
|
|
129
|
-
|
|
153
|
+
Returns
|
|
154
|
+
-------
|
|
155
|
+
None
|
|
130
156
|
"""
|
|
131
157
|
with self.assertRaises(TypeError):
|
|
132
158
|
Database('sqlite', Connections())
|
|
@@ -4,18 +4,23 @@ from orionis.test.cases.asynchronous import AsyncTestCase
|
|
|
4
4
|
|
|
5
5
|
class TestFoundationConfigFilesystemsAws(AsyncTestCase):
|
|
6
6
|
"""
|
|
7
|
-
|
|
7
|
+
Unit tests for the S3 storage configuration entity.
|
|
8
8
|
|
|
9
|
-
This class
|
|
10
|
-
|
|
11
|
-
conversion, hashability, and keyword-only initialization.
|
|
9
|
+
This test class validates the behavior of the S3 configuration entity, including
|
|
10
|
+
default value assignment, field validation, custom value handling, dictionary
|
|
11
|
+
conversion, hashability, and enforcement of keyword-only initialization.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
async def testDefaultValues(self):
|
|
15
15
|
"""
|
|
16
|
-
|
|
16
|
+
Validate default values of S3 configuration fields.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Ensures that a newly created S3 instance has the expected default values
|
|
19
|
+
for all attributes as defined in the class.
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
None
|
|
19
24
|
"""
|
|
20
25
|
s3 = S3()
|
|
21
26
|
self.assertEqual(s3.key, "")
|
|
@@ -29,9 +34,10 @@ class TestFoundationConfigFilesystemsAws(AsyncTestCase):
|
|
|
29
34
|
|
|
30
35
|
async def testRequiredFieldValidation(self):
|
|
31
36
|
"""
|
|
32
|
-
|
|
37
|
+
Validate required field constraints for S3 configuration.
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
Checks that the 'region' field must be a non-empty string and raises
|
|
40
|
+
OrionisIntegrityException if the constraint is violated.
|
|
35
41
|
|
|
36
42
|
Raises
|
|
37
43
|
------
|
|
@@ -48,9 +54,10 @@ class TestFoundationConfigFilesystemsAws(AsyncTestCase):
|
|
|
48
54
|
|
|
49
55
|
async def testOptionalFieldValidation(self):
|
|
50
56
|
"""
|
|
51
|
-
|
|
57
|
+
Validate optional field types for S3 configuration.
|
|
52
58
|
|
|
53
|
-
Ensures that optional fields accept None or
|
|
59
|
+
Ensures that optional fields accept None or valid types, and raises
|
|
60
|
+
OrionisIntegrityException for invalid types.
|
|
54
61
|
|
|
55
62
|
Raises
|
|
56
63
|
------
|
|
@@ -72,9 +79,10 @@ class TestFoundationConfigFilesystemsAws(AsyncTestCase):
|
|
|
72
79
|
|
|
73
80
|
async def testBooleanFieldValidation(self):
|
|
74
81
|
"""
|
|
75
|
-
|
|
82
|
+
Validate boolean field types for S3 configuration.
|
|
76
83
|
|
|
77
|
-
Ensures that boolean fields only
|
|
84
|
+
Ensures that boolean fields accept only boolean values and raises
|
|
85
|
+
OrionisIntegrityException for invalid types.
|
|
78
86
|
|
|
79
87
|
Raises
|
|
80
88
|
------
|
|
@@ -91,10 +99,14 @@ class TestFoundationConfigFilesystemsAws(AsyncTestCase):
|
|
|
91
99
|
|
|
92
100
|
async def testCustomValues(self):
|
|
93
101
|
"""
|
|
94
|
-
|
|
102
|
+
Validate assignment and storage of custom values in S3 configuration.
|
|
95
103
|
|
|
96
|
-
Ensures custom
|
|
104
|
+
Ensures that custom values provided during initialization are correctly
|
|
105
|
+
stored and validated in the S3 instance.
|
|
97
106
|
|
|
107
|
+
Returns
|
|
108
|
+
-------
|
|
109
|
+
None
|
|
98
110
|
"""
|
|
99
111
|
custom_s3 = S3(
|
|
100
112
|
key="AKIAEXAMPLE",
|
|
@@ -118,14 +130,14 @@ class TestFoundationConfigFilesystemsAws(AsyncTestCase):
|
|
|
118
130
|
|
|
119
131
|
async def testToDictMethod(self):
|
|
120
132
|
"""
|
|
121
|
-
|
|
133
|
+
Validate dictionary conversion of S3 configuration.
|
|
122
134
|
|
|
123
|
-
Ensures
|
|
135
|
+
Ensures that the toDict method returns a dictionary containing all
|
|
136
|
+
attributes of the S3 instance with correct values.
|
|
124
137
|
|
|
125
138
|
Returns
|
|
126
139
|
-------
|
|
127
|
-
|
|
128
|
-
Dictionary representation of the S3 instance.
|
|
140
|
+
None
|
|
129
141
|
"""
|
|
130
142
|
s3 = S3()
|
|
131
143
|
s3_dict = s3.toDict()
|
|
@@ -142,9 +154,14 @@ class TestFoundationConfigFilesystemsAws(AsyncTestCase):
|
|
|
142
154
|
|
|
143
155
|
async def testHashability(self):
|
|
144
156
|
"""
|
|
145
|
-
|
|
157
|
+
Validate hashability of S3 configuration instances.
|
|
158
|
+
|
|
159
|
+
Ensures that S3 instances are hashable and can be used in sets and as
|
|
160
|
+
dictionary keys due to unsafe_hash=True.
|
|
146
161
|
|
|
147
|
-
|
|
162
|
+
Returns
|
|
163
|
+
-------
|
|
164
|
+
None
|
|
148
165
|
"""
|
|
149
166
|
s3_1 = S3()
|
|
150
167
|
s3_2 = S3()
|
|
@@ -158,9 +175,10 @@ class TestFoundationConfigFilesystemsAws(AsyncTestCase):
|
|
|
158
175
|
|
|
159
176
|
async def testKwOnlyInitialization(self):
|
|
160
177
|
"""
|
|
161
|
-
|
|
178
|
+
Validate enforcement of keyword-only initialization for S3.
|
|
162
179
|
|
|
163
|
-
Ensures that
|
|
180
|
+
Ensures that S3 cannot be initialized with positional arguments and
|
|
181
|
+
raises TypeError if attempted.
|
|
164
182
|
|
|
165
183
|
Raises
|
|
166
184
|
------
|
|
@@ -4,41 +4,23 @@ from orionis.test.cases.asynchronous import AsyncTestCase
|
|
|
4
4
|
|
|
5
5
|
class TestFoundationConfigFilesystemsPublic(AsyncTestCase):
|
|
6
6
|
"""
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
This class
|
|
10
|
-
|
|
11
|
-
whitespace handling, hashability, and keyword-only initialization.
|
|
12
|
-
|
|
13
|
-
Methods
|
|
14
|
-
-------
|
|
15
|
-
testDefaultValues()
|
|
16
|
-
Test that Public instance is created with correct default values.
|
|
17
|
-
testCustomValues()
|
|
18
|
-
Test that custom path and url can be set during initialization.
|
|
19
|
-
testEmptyPathValidation()
|
|
20
|
-
Test that empty paths are rejected.
|
|
21
|
-
testEmptyUrlValidation()
|
|
22
|
-
Test that empty URLs are rejected.
|
|
23
|
-
testTypeValidation()
|
|
24
|
-
Test that non-string values are rejected for both attributes.
|
|
25
|
-
testToDictMethod()
|
|
26
|
-
Test that toDict returns proper dictionary representation.
|
|
27
|
-
testCustomValuesToDict()
|
|
28
|
-
Test that custom values are properly included in dictionary representation.
|
|
29
|
-
testWhitespaceHandling()
|
|
30
|
-
Test that values with whitespace are accepted but not automatically trimmed.
|
|
31
|
-
testHashability()
|
|
32
|
-
Test that Public maintains hashability due to unsafe_hash=True.
|
|
33
|
-
testKwOnlyInitialization()
|
|
34
|
-
Test that Public enforces keyword-only initialization.
|
|
7
|
+
Asynchronous unit tests for the `Public` storage configuration class.
|
|
8
|
+
|
|
9
|
+
This class validates the behavior of the `Public` storage configuration, including
|
|
10
|
+
default and custom value assignment, input validation, dictionary conversion,
|
|
11
|
+
whitespace handling, hashability, and enforcement of keyword-only initialization.
|
|
35
12
|
"""
|
|
36
13
|
|
|
37
14
|
async def testDefaultValues(self):
|
|
38
15
|
"""
|
|
39
|
-
Test
|
|
16
|
+
Test creation of a Public instance with default values.
|
|
17
|
+
|
|
18
|
+
Ensures that the default `path` and `url` attributes are set as defined
|
|
19
|
+
in the class.
|
|
40
20
|
|
|
41
|
-
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
None
|
|
42
24
|
"""
|
|
43
25
|
public = Public()
|
|
44
26
|
self.assertEqual(public.path, "storage/app/public")
|
|
@@ -46,9 +28,14 @@ class TestFoundationConfigFilesystemsPublic(AsyncTestCase):
|
|
|
46
28
|
|
|
47
29
|
async def testCustomValues(self):
|
|
48
30
|
"""
|
|
49
|
-
Test
|
|
31
|
+
Test assignment of custom values to path and url.
|
|
32
|
+
|
|
33
|
+
Checks that custom `path` and `url` values are accepted and stored
|
|
34
|
+
correctly during initialization.
|
|
50
35
|
|
|
51
|
-
|
|
36
|
+
Returns
|
|
37
|
+
-------
|
|
38
|
+
None
|
|
52
39
|
"""
|
|
53
40
|
custom_path = "custom/public/path"
|
|
54
41
|
custom_url = "assets"
|
|
@@ -58,27 +45,42 @@ class TestFoundationConfigFilesystemsPublic(AsyncTestCase):
|
|
|
58
45
|
|
|
59
46
|
async def testEmptyPathValidation(self):
|
|
60
47
|
"""
|
|
61
|
-
Test
|
|
48
|
+
Test validation for empty path values.
|
|
62
49
|
|
|
63
|
-
Verifies that an empty path raises
|
|
50
|
+
Verifies that providing an empty string for `path` raises
|
|
51
|
+
OrionisIntegrityException.
|
|
52
|
+
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
None
|
|
64
56
|
"""
|
|
65
57
|
with self.assertRaises(OrionisIntegrityException):
|
|
66
58
|
Public(path="")
|
|
67
59
|
|
|
68
60
|
async def testEmptyUrlValidation(self):
|
|
69
61
|
"""
|
|
70
|
-
Test
|
|
62
|
+
Test validation for empty url values.
|
|
63
|
+
|
|
64
|
+
Verifies that providing an empty string for `url` raises
|
|
65
|
+
OrionisIntegrityException.
|
|
71
66
|
|
|
72
|
-
|
|
67
|
+
Returns
|
|
68
|
+
-------
|
|
69
|
+
None
|
|
73
70
|
"""
|
|
74
71
|
with self.assertRaises(OrionisIntegrityException):
|
|
75
72
|
Public(url="")
|
|
76
73
|
|
|
77
74
|
async def testTypeValidation(self):
|
|
78
75
|
"""
|
|
79
|
-
Test
|
|
76
|
+
Test type validation for path and url attributes.
|
|
77
|
+
|
|
78
|
+
Ensures that non-string values for `path` and `url` raise
|
|
79
|
+
OrionisIntegrityException.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Returns
|
|
82
|
+
-------
|
|
83
|
+
None
|
|
82
84
|
"""
|
|
83
85
|
# Test path validation
|
|
84
86
|
with self.assertRaises(OrionisIntegrityException):
|
|
@@ -94,9 +96,14 @@ class TestFoundationConfigFilesystemsPublic(AsyncTestCase):
|
|
|
94
96
|
|
|
95
97
|
async def testToDictMethod(self):
|
|
96
98
|
"""
|
|
97
|
-
Test
|
|
99
|
+
Test the toDict method for correct dictionary output.
|
|
98
100
|
|
|
99
|
-
|
|
101
|
+
Ensures that the dictionary representation contains the correct
|
|
102
|
+
default values for `path` and `url`.
|
|
103
|
+
|
|
104
|
+
Returns
|
|
105
|
+
-------
|
|
106
|
+
None
|
|
100
107
|
"""
|
|
101
108
|
public = Public()
|
|
102
109
|
config_dict = public.toDict()
|
|
@@ -107,9 +114,14 @@ class TestFoundationConfigFilesystemsPublic(AsyncTestCase):
|
|
|
107
114
|
|
|
108
115
|
async def testCustomValuesToDict(self):
|
|
109
116
|
"""
|
|
110
|
-
Test
|
|
117
|
+
Test dictionary output with custom values.
|
|
118
|
+
|
|
119
|
+
Ensures that the dictionary representation includes custom
|
|
120
|
+
`path` and `url` values when specified.
|
|
111
121
|
|
|
112
|
-
|
|
122
|
+
Returns
|
|
123
|
+
-------
|
|
124
|
+
None
|
|
113
125
|
"""
|
|
114
126
|
custom_path = "public/assets"
|
|
115
127
|
custom_url = "cdn"
|
|
@@ -121,9 +133,14 @@ class TestFoundationConfigFilesystemsPublic(AsyncTestCase):
|
|
|
121
133
|
|
|
122
134
|
async def testWhitespaceHandling(self):
|
|
123
135
|
"""
|
|
124
|
-
Test
|
|
136
|
+
Test handling of whitespace in attribute values.
|
|
137
|
+
|
|
138
|
+
Verifies that values containing whitespace are accepted and
|
|
139
|
+
not automatically trimmed.
|
|
125
140
|
|
|
126
|
-
|
|
141
|
+
Returns
|
|
142
|
+
-------
|
|
143
|
+
None
|
|
127
144
|
"""
|
|
128
145
|
spaced_path = " public/storage "
|
|
129
146
|
spaced_url = " static/files "
|
|
@@ -133,9 +150,14 @@ class TestFoundationConfigFilesystemsPublic(AsyncTestCase):
|
|
|
133
150
|
|
|
134
151
|
async def testHashability(self):
|
|
135
152
|
"""
|
|
136
|
-
Test
|
|
153
|
+
Test hashability of Public instances.
|
|
137
154
|
|
|
138
|
-
|
|
155
|
+
Ensures that Public instances are hashable and can be used in sets
|
|
156
|
+
and as dictionary keys due to `unsafe_hash=True`.
|
|
157
|
+
|
|
158
|
+
Returns
|
|
159
|
+
-------
|
|
160
|
+
None
|
|
139
161
|
"""
|
|
140
162
|
public1 = Public()
|
|
141
163
|
public2 = Public()
|
|
@@ -149,9 +171,14 @@ class TestFoundationConfigFilesystemsPublic(AsyncTestCase):
|
|
|
149
171
|
|
|
150
172
|
async def testKwOnlyInitialization(self):
|
|
151
173
|
"""
|
|
152
|
-
Test
|
|
174
|
+
Test enforcement of keyword-only initialization.
|
|
175
|
+
|
|
176
|
+
Verifies that positional arguments are not allowed when initializing
|
|
177
|
+
a Public instance.
|
|
153
178
|
|
|
154
|
-
|
|
179
|
+
Returns
|
|
180
|
+
-------
|
|
181
|
+
None
|
|
155
182
|
"""
|
|
156
183
|
with self.assertRaises(TypeError):
|
|
157
184
|
Public("storage/path", "static")
|