orionis 0.431.0__py3-none-any.whl → 0.434.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/app.py +17 -0
- orionis/console/commands/version.py +2 -2
- orionis/console/core/reactor.py +1 -1
- orionis/foundation/config/roots/paths.py +2 -2
- orionis/metadata/framework.py +38 -65
- orionis/metadata/package.py +280 -54
- orionis/support/entities/base.py +18 -37
- orionis/support/facades/console.py +3 -9
- orionis/support/facades/dumper.py +3 -9
- orionis/support/facades/logger.py +3 -9
- orionis/support/facades/path_resolver.py +3 -10
- orionis/support/facades/progress_bar.py +3 -10
- orionis/support/facades/testing.py +4 -10
- orionis/support/facades/workers.py +4 -9
- orionis/support/formatter/exceptions/contracts/parser.py +10 -7
- orionis/support/formatter/exceptions/parser.py +28 -26
- orionis/support/formatter/serializer.py +12 -5
- orionis/support/patterns/singleton/meta.py +17 -21
- orionis/support/standard/contracts/std.py +25 -24
- orionis/support/standard/exceptions/value.py +2 -2
- orionis/support/standard/std.py +26 -24
- orionis/support/wrapper/dot_dict.py +16 -51
- orionis/test/cases/asynchronous.py +17 -81
- orionis/test/cases/synchronous.py +17 -73
- orionis/test/contracts/dumper.py +17 -21
- orionis/test/contracts/kernel.py +5 -12
- orionis/test/contracts/logs.py +16 -21
- orionis/test/contracts/printer.py +70 -8
- orionis/test/contracts/render.py +7 -13
- orionis/test/contracts/test_result.py +58 -27
- orionis/test/contracts/unit_test.py +18 -18
- orionis/test/core/unit_test.py +162 -519
- orionis/test/entities/result.py +49 -21
- orionis/test/enums/status.py +11 -17
- orionis/test/exceptions/config.py +4 -8
- orionis/test/exceptions/failure.py +2 -18
- orionis/test/exceptions/persistence.py +4 -8
- orionis/test/exceptions/runtime.py +4 -8
- orionis/test/exceptions/value.py +5 -13
- orionis/test/kernel.py +14 -42
- orionis/test/output/dumper.py +21 -43
- orionis/test/output/printer.py +6 -146
- orionis/test/records/logs.py +57 -121
- orionis/test/validators/base_path.py +8 -6
- orionis/test/validators/execution_mode.py +2 -3
- orionis/test/validators/fail_fast.py +4 -8
- orionis/test/validators/folder_path.py +5 -7
- orionis/test/validators/module_name.py +3 -3
- orionis/test/validators/name_pattern.py +4 -9
- orionis/test/validators/pattern.py +4 -9
- orionis/test/validators/persistent.py +4 -14
- orionis/test/validators/persistent_driver.py +7 -12
- orionis/test/validators/print_result.py +4 -9
- orionis/test/validators/tags.py +6 -7
- orionis/test/validators/throw_exception.py +7 -14
- orionis/test/validators/verbosity.py +15 -5
- orionis/test/validators/web_report.py +6 -10
- orionis/test/validators/workers.py +9 -4
- orionis/test/view/render.py +9 -26
- {orionis-0.431.0.dist-info → orionis-0.434.0.dist-info}/METADATA +1 -1
- {orionis-0.431.0.dist-info → orionis-0.434.0.dist-info}/RECORD +82 -81
- tests/metadata/test_metadata_framework.py +64 -90
- tests/metadata/test_metadata_package.py +31 -31
- tests/support/entities/mock_dataclass.py +16 -10
- tests/support/entities/test_base.py +6 -14
- tests/support/patterns/singleton/test_patterns_singleton.py +7 -8
- tests/support/standard/test_services_std.py +113 -37
- tests/support/wrapper/test_services_wrapper_docdict.py +25 -40
- tests/testing/cases/test_testing_asynchronous.py +14 -14
- tests/testing/cases/test_testing_synchronous.py +12 -14
- tests/testing/entities/test_testing_result.py +12 -51
- tests/testing/enums/test_testing_status.py +8 -13
- tests/testing/output/test_testing_dumper.py +3 -6
- tests/testing/output/test_testing_printer.py +5 -5
- tests/testing/records/test_testing_records.py +16 -26
- tests/testing/test_testing_unit.py +8 -94
- tests/testing/validators/test_testing_validators.py +55 -112
- tests/testing/view/test_render.py +4 -5
- {orionis-0.431.0.dist-info → orionis-0.434.0.dist-info}/WHEEL +0 -0
- {orionis-0.431.0.dist-info → orionis-0.434.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.431.0.dist-info → orionis-0.434.0.dist-info}/top_level.txt +0 -0
- {orionis-0.431.0.dist-info → orionis-0.434.0.dist-info}/zip-safe +0 -0
|
@@ -5,18 +5,16 @@ class TestSupportWrapperDocDict(AsyncTestCase):
|
|
|
5
5
|
|
|
6
6
|
async def testDotNotationAccess(self):
|
|
7
7
|
"""
|
|
8
|
-
|
|
8
|
+
Test dot notation access for dictionary values.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
Checks that values in a DotDict instance can be accessed using dot notation,
|
|
11
|
+
including nested dictionaries via chained dot notation. Also verifies that
|
|
12
|
+
accessing a non-existent key returns None.
|
|
13
13
|
|
|
14
14
|
Returns
|
|
15
15
|
-------
|
|
16
16
|
None
|
|
17
|
-
This is a test method and does not return a value.
|
|
18
17
|
"""
|
|
19
|
-
|
|
20
18
|
# Create a DotDict instance with initial values
|
|
21
19
|
dd = DotDict({'key1': 'value1', 'nested': {'inner': 42}})
|
|
22
20
|
|
|
@@ -31,18 +29,16 @@ class TestSupportWrapperDocDict(AsyncTestCase):
|
|
|
31
29
|
|
|
32
30
|
async def testDotNotationAssignment(self):
|
|
33
31
|
"""
|
|
34
|
-
|
|
32
|
+
Test assignment of dictionary values using dot notation.
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
Verifies that new keys can be added and existing keys updated using dot notation.
|
|
35
|
+
Also checks that nested dictionaries assigned via dot notation are automatically
|
|
36
|
+
converted to DotDict instances.
|
|
39
37
|
|
|
40
38
|
Returns
|
|
41
39
|
-------
|
|
42
40
|
None
|
|
43
|
-
This is a test method and does not return a value.
|
|
44
41
|
"""
|
|
45
|
-
|
|
46
42
|
# Create a DotDict instance and assign values using dot notation
|
|
47
43
|
dd = DotDict()
|
|
48
44
|
|
|
@@ -59,17 +55,15 @@ class TestSupportWrapperDocDict(AsyncTestCase):
|
|
|
59
55
|
|
|
60
56
|
async def testDotNotationDeletion(self):
|
|
61
57
|
"""
|
|
62
|
-
|
|
58
|
+
Test deletion of dictionary keys using dot notation.
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
Ensures that existing keys can be deleted using dot notation and that attempting
|
|
61
|
+
to delete a non-existent key raises an AttributeError.
|
|
66
62
|
|
|
67
63
|
Returns
|
|
68
64
|
-------
|
|
69
65
|
None
|
|
70
|
-
This is a test method and does not return a value.
|
|
71
66
|
"""
|
|
72
|
-
|
|
73
67
|
# Create a DotDict instance and delete an existing key
|
|
74
68
|
dd = DotDict({'key1': 'value1', 'key2': 'value2'})
|
|
75
69
|
|
|
@@ -83,18 +77,16 @@ class TestSupportWrapperDocDict(AsyncTestCase):
|
|
|
83
77
|
|
|
84
78
|
async def testGetMethod(self):
|
|
85
79
|
"""
|
|
86
|
-
|
|
80
|
+
Test the `get` method with automatic DotDict conversion.
|
|
87
81
|
|
|
88
|
-
|
|
89
|
-
returns the provided default for missing keys, and converts nested dictionaries
|
|
90
|
-
DotDict instances when accessed.
|
|
82
|
+
Verifies that the `get` method returns the correct value for a given key,
|
|
83
|
+
returns the provided default for missing keys, and converts nested dictionaries
|
|
84
|
+
to DotDict instances when accessed.
|
|
91
85
|
|
|
92
86
|
Returns
|
|
93
87
|
-------
|
|
94
88
|
None
|
|
95
|
-
This is a test method and does not return a value.
|
|
96
89
|
"""
|
|
97
|
-
|
|
98
90
|
# Create a DotDict instance and test the `get` method
|
|
99
91
|
dd = DotDict({'key1': 'value1', 'nested': {'inner': 42}})
|
|
100
92
|
|
|
@@ -107,17 +99,15 @@ class TestSupportWrapperDocDict(AsyncTestCase):
|
|
|
107
99
|
|
|
108
100
|
async def testExportMethod(self):
|
|
109
101
|
"""
|
|
110
|
-
|
|
102
|
+
Test the `export` method for recursive conversion to regular dict.
|
|
111
103
|
|
|
112
|
-
|
|
104
|
+
Ensures that calling `export` on a DotDict instance recursively converts
|
|
113
105
|
all nested DotDict objects back to regular Python dictionaries.
|
|
114
106
|
|
|
115
107
|
Returns
|
|
116
108
|
-------
|
|
117
109
|
None
|
|
118
|
-
This is a test method and does not return a value.
|
|
119
110
|
"""
|
|
120
|
-
|
|
121
111
|
# Create a DotDict instance and export it
|
|
122
112
|
dd = DotDict({
|
|
123
113
|
'key1': 'value1',
|
|
@@ -137,18 +127,16 @@ class TestSupportWrapperDocDict(AsyncTestCase):
|
|
|
137
127
|
|
|
138
128
|
async def testCopyMethod(self):
|
|
139
129
|
"""
|
|
140
|
-
|
|
130
|
+
Test the `copy` method for deep copy with DotDict conversion.
|
|
141
131
|
|
|
142
|
-
|
|
143
|
-
with all nested dictionaries converted to DotDict instances.
|
|
144
|
-
to the copy do not affect the original.
|
|
132
|
+
Verifies that copying a DotDict instance produces an independent copy,
|
|
133
|
+
with all nested dictionaries converted to DotDict instances. Checks that
|
|
134
|
+
changes to the copy do not affect the original.
|
|
145
135
|
|
|
146
136
|
Returns
|
|
147
137
|
-------
|
|
148
138
|
None
|
|
149
|
-
This is a test method and does not return a value.
|
|
150
139
|
"""
|
|
151
|
-
|
|
152
140
|
# Create a DotDict instance and copy it
|
|
153
141
|
original = DotDict({
|
|
154
142
|
'key1': 'value1',
|
|
@@ -171,15 +159,14 @@ class TestSupportWrapperDocDict(AsyncTestCase):
|
|
|
171
159
|
|
|
172
160
|
async def testNestedDictConversion(self):
|
|
173
161
|
"""
|
|
174
|
-
|
|
162
|
+
Test automatic conversion of nested dictionaries to DotDict.
|
|
175
163
|
|
|
176
|
-
|
|
164
|
+
Verifies that nested dictionaries are converted to DotDict instances
|
|
177
165
|
both during initialization and dynamic assignment.
|
|
178
166
|
|
|
179
167
|
Returns
|
|
180
168
|
-------
|
|
181
169
|
None
|
|
182
|
-
This is a test method and does not return a value.
|
|
183
170
|
"""
|
|
184
171
|
dd = DotDict({
|
|
185
172
|
'level1': {
|
|
@@ -201,17 +188,15 @@ class TestSupportWrapperDocDict(AsyncTestCase):
|
|
|
201
188
|
|
|
202
189
|
async def testReprMethod(self):
|
|
203
190
|
"""
|
|
204
|
-
|
|
191
|
+
Test the string representation of DotDict.
|
|
205
192
|
|
|
206
|
-
|
|
193
|
+
Verifies that the `__repr__` method of DotDict returns a string
|
|
207
194
|
representation that includes the DotDict prefix.
|
|
208
195
|
|
|
209
196
|
Returns
|
|
210
197
|
-------
|
|
211
198
|
None
|
|
212
|
-
This is a test method and does not return a value.
|
|
213
199
|
"""
|
|
214
|
-
|
|
215
200
|
# Create a DotDict instance and test its string representation
|
|
216
201
|
dd = DotDict({'key': 'value'})
|
|
217
202
|
self.assertEqual(repr(dd), "{'key': 'value'}")
|
|
@@ -5,22 +5,22 @@ class TestAsyncTestCase(AsyncTestCase):
|
|
|
5
5
|
|
|
6
6
|
async def testMethodsExist(self):
|
|
7
7
|
"""
|
|
8
|
-
|
|
8
|
+
Verify that AsyncTestCase defines the required asynchronous lifecycle methods.
|
|
9
9
|
|
|
10
10
|
Parameters
|
|
11
11
|
----------
|
|
12
12
|
self : TestAsyncTestCase
|
|
13
|
-
|
|
13
|
+
Instance of the test case.
|
|
14
14
|
|
|
15
15
|
Returns
|
|
16
16
|
-------
|
|
17
17
|
None
|
|
18
|
-
This method does not return
|
|
18
|
+
This method does not return a value.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
Raises
|
|
21
|
+
------
|
|
22
|
+
AssertionError
|
|
23
|
+
If any of the required methods do not exist in AsyncTestCase.
|
|
24
24
|
"""
|
|
25
25
|
required_methods = [
|
|
26
26
|
"asyncSetUp",
|
|
@@ -34,22 +34,22 @@ class TestAsyncTestCase(AsyncTestCase):
|
|
|
34
34
|
|
|
35
35
|
async def testMethodsAreCoroutines(self):
|
|
36
36
|
"""
|
|
37
|
-
|
|
37
|
+
Check that all required asynchronous lifecycle methods in AsyncTestCase are coroutine functions.
|
|
38
38
|
|
|
39
39
|
Parameters
|
|
40
40
|
----------
|
|
41
41
|
self : TestAsyncTestCase
|
|
42
|
-
|
|
42
|
+
Instance of the test case.
|
|
43
43
|
|
|
44
44
|
Returns
|
|
45
45
|
-------
|
|
46
46
|
None
|
|
47
|
-
This method does not return
|
|
47
|
+
This method does not return a value.
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
Raises
|
|
50
|
+
------
|
|
51
|
+
AssertionError
|
|
52
|
+
If any of the required methods are not coroutine functions.
|
|
53
53
|
"""
|
|
54
54
|
required_methods = [
|
|
55
55
|
"asyncSetUp",
|
|
@@ -6,18 +6,17 @@ class TestSyncTestCase(AsyncTestCase):
|
|
|
6
6
|
|
|
7
7
|
async def testHasMethods(self):
|
|
8
8
|
"""
|
|
9
|
-
|
|
9
|
+
Verify that SyncTestCase defines the required synchronous lifecycle methods.
|
|
10
10
|
|
|
11
|
-
This
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
This method asserts the presence of the following methods in SyncTestCase:
|
|
12
|
+
- setUp
|
|
13
|
+
- tearDown
|
|
14
|
+
- onSetup
|
|
15
|
+
- onTeardown
|
|
16
16
|
|
|
17
17
|
Returns
|
|
18
18
|
-------
|
|
19
19
|
None
|
|
20
|
-
This method does not return any value. It performs assertions to validate the presence of required methods.
|
|
21
20
|
"""
|
|
22
21
|
# Assert that SyncTestCase has a setUp method
|
|
23
22
|
self.assertTrue(hasattr(SyncTestCase, "setUp"))
|
|
@@ -33,18 +32,17 @@ class TestSyncTestCase(AsyncTestCase):
|
|
|
33
32
|
|
|
34
33
|
async def testMethodsAreNotCoroutines(self):
|
|
35
34
|
"""
|
|
36
|
-
|
|
35
|
+
Ensure that the lifecycle methods of SyncTestCase are synchronous functions.
|
|
37
36
|
|
|
38
|
-
This
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
This method checks that the following methods are not coroutine functions:
|
|
38
|
+
- setUp
|
|
39
|
+
- tearDown
|
|
40
|
+
- onSetup
|
|
41
|
+
- onTeardown
|
|
43
42
|
|
|
44
43
|
Returns
|
|
45
44
|
-------
|
|
46
45
|
None
|
|
47
|
-
This method does not return any value. It performs assertions to confirm that the methods are not coroutine functions.
|
|
48
46
|
"""
|
|
49
47
|
# Assert that setUp is not a coroutine function
|
|
50
48
|
self.assertFalse(inspect.iscoroutinefunction(SyncTestCase.setUp))
|
|
@@ -6,17 +6,10 @@ class TestTestingResult(AsyncTestCase):
|
|
|
6
6
|
|
|
7
7
|
async def testDefaultValues(self) -> None:
|
|
8
8
|
"""
|
|
9
|
-
|
|
9
|
+
Test that optional fields in TestResult are set to None by default.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- traceback
|
|
14
|
-
- class_name
|
|
15
|
-
- method
|
|
16
|
-
- module
|
|
17
|
-
- file_path
|
|
18
|
-
|
|
19
|
-
The method asserts that each of these fields is None after instantiating TestResult with only required arguments.
|
|
11
|
+
Checks that the fields `error_message`, `traceback`, `class_name`, `method`, `module`, and `file_path`
|
|
12
|
+
are None when not provided during initialization.
|
|
20
13
|
|
|
21
14
|
Parameters
|
|
22
15
|
----------
|
|
@@ -26,11 +19,6 @@ class TestTestingResult(AsyncTestCase):
|
|
|
26
19
|
Returns
|
|
27
20
|
-------
|
|
28
21
|
None
|
|
29
|
-
This method does not return any value. It performs assertions to validate default field values.
|
|
30
|
-
|
|
31
|
-
Notes
|
|
32
|
-
-----
|
|
33
|
-
This test verifies that the TestResult dataclass correctly initializes optional fields to None when they are omitted.
|
|
34
22
|
"""
|
|
35
23
|
# Create a TestResult instance with only required fields
|
|
36
24
|
result = TestResult(
|
|
@@ -49,9 +37,9 @@ class TestTestingResult(AsyncTestCase):
|
|
|
49
37
|
|
|
50
38
|
async def testRequiredFields(self) -> None:
|
|
51
39
|
"""
|
|
52
|
-
|
|
40
|
+
Test that TestResult enforces required fields during initialization.
|
|
53
41
|
|
|
54
|
-
|
|
42
|
+
Verifies that omitting required fields raises a TypeError.
|
|
55
43
|
|
|
56
44
|
Parameters
|
|
57
45
|
----------
|
|
@@ -61,13 +49,6 @@ class TestTestingResult(AsyncTestCase):
|
|
|
61
49
|
Returns
|
|
62
50
|
-------
|
|
63
51
|
None
|
|
64
|
-
This method does not return any value. It performs assertions to validate required field enforcement.
|
|
65
|
-
|
|
66
|
-
Notes
|
|
67
|
-
-----
|
|
68
|
-
- Attempts to instantiate TestResult with no arguments.
|
|
69
|
-
- Attempts to instantiate TestResult missing the 'id' field.
|
|
70
|
-
- Expects a TypeError to be raised in both cases.
|
|
71
52
|
"""
|
|
72
53
|
# Attempt to create TestResult with no arguments; should raise TypeError
|
|
73
54
|
with self.assertRaises(TypeError):
|
|
@@ -83,9 +64,9 @@ class TestTestingResult(AsyncTestCase):
|
|
|
83
64
|
|
|
84
65
|
async def testImmutable(self) -> None:
|
|
85
66
|
"""
|
|
86
|
-
|
|
67
|
+
Test that TestResult instances are immutable.
|
|
87
68
|
|
|
88
|
-
Ensures that
|
|
69
|
+
Ensures that modifying an attribute of a TestResult instance raises an exception.
|
|
89
70
|
|
|
90
71
|
Parameters
|
|
91
72
|
----------
|
|
@@ -95,16 +76,6 @@ class TestTestingResult(AsyncTestCase):
|
|
|
95
76
|
Returns
|
|
96
77
|
-------
|
|
97
78
|
None
|
|
98
|
-
This method does not return any value. It performs assertions to validate immutability.
|
|
99
|
-
|
|
100
|
-
Raises
|
|
101
|
-
------
|
|
102
|
-
Exception
|
|
103
|
-
If an attempt is made to modify an attribute of a frozen TestResult instance.
|
|
104
|
-
|
|
105
|
-
Notes
|
|
106
|
-
-----
|
|
107
|
-
Attempts to modify the 'name' attribute of a TestResult instance and expects an exception to be raised.
|
|
108
79
|
"""
|
|
109
80
|
# Create a TestResult instance
|
|
110
81
|
result = TestResult(
|
|
@@ -119,9 +90,9 @@ class TestTestingResult(AsyncTestCase):
|
|
|
119
90
|
|
|
120
91
|
async def testStatusValues(self) -> None:
|
|
121
92
|
"""
|
|
122
|
-
|
|
93
|
+
Test that all TestStatus enum values can be assigned to TestResult.
|
|
123
94
|
|
|
124
|
-
Iterates
|
|
95
|
+
Iterates through each TestStatus value and checks assignment to the status field.
|
|
125
96
|
|
|
126
97
|
Parameters
|
|
127
98
|
----------
|
|
@@ -131,11 +102,6 @@ class TestTestingResult(AsyncTestCase):
|
|
|
131
102
|
Returns
|
|
132
103
|
-------
|
|
133
104
|
None
|
|
134
|
-
This method does not return any value. It performs assertions to validate status assignment.
|
|
135
|
-
|
|
136
|
-
Notes
|
|
137
|
-
-----
|
|
138
|
-
This test ensures that the status field in TestResult supports all enum values defined in TestStatus.
|
|
139
105
|
"""
|
|
140
106
|
# Iterate through all possible TestStatus values
|
|
141
107
|
for status in TestStatus:
|
|
@@ -151,9 +117,9 @@ class TestTestingResult(AsyncTestCase):
|
|
|
151
117
|
|
|
152
118
|
async def testErrorFields(self) -> None:
|
|
153
119
|
"""
|
|
154
|
-
|
|
120
|
+
Test that error_message and traceback fields are stored correctly in TestResult.
|
|
155
121
|
|
|
156
|
-
|
|
122
|
+
Verifies that providing values for error_message and traceback sets them as expected.
|
|
157
123
|
|
|
158
124
|
Parameters
|
|
159
125
|
----------
|
|
@@ -163,11 +129,6 @@ class TestTestingResult(AsyncTestCase):
|
|
|
163
129
|
Returns
|
|
164
130
|
-------
|
|
165
131
|
None
|
|
166
|
-
This method does not return any value. It performs assertions to validate error field assignment.
|
|
167
|
-
|
|
168
|
-
Notes
|
|
169
|
-
-----
|
|
170
|
-
This test ensures that error-related fields are properly assigned and retrievable from the TestResult instance.
|
|
171
132
|
"""
|
|
172
133
|
error_msg = "Test failed"
|
|
173
134
|
traceback = "Traceback info"
|
|
@@ -182,4 +143,4 @@ class TestTestingResult(AsyncTestCase):
|
|
|
182
143
|
)
|
|
183
144
|
# Assert that error_message and traceback fields are set correctly
|
|
184
145
|
self.assertEqual(result.error_message, error_msg)
|
|
185
|
-
self.assertEqual(result.traceback, traceback)
|
|
146
|
+
self.assertEqual(result.traceback, traceback)
|
|
@@ -6,15 +6,13 @@ class TestTestStatus(AsyncTestCase):
|
|
|
6
6
|
|
|
7
7
|
async def testHasEnumMembers(self):
|
|
8
8
|
"""
|
|
9
|
-
|
|
9
|
+
Test that the TestStatus enum contains the expected members.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
'PASSED', 'FAILED', 'ERRORED', and 'SKIPPED'.
|
|
11
|
+
Checks for the presence of the 'PASSED', 'FAILED', 'ERRORED', and 'SKIPPED' members in the TestStatus enum.
|
|
13
12
|
|
|
14
13
|
Returns
|
|
15
14
|
-------
|
|
16
15
|
None
|
|
17
|
-
This method does not return a value. It asserts the existence of enum members.
|
|
18
16
|
"""
|
|
19
17
|
# Assert that each expected member exists in TestStatus
|
|
20
18
|
self.assertTrue(hasattr(TestStatus, "PASSED"))
|
|
@@ -24,14 +22,13 @@ class TestTestStatus(AsyncTestCase):
|
|
|
24
22
|
|
|
25
23
|
async def testEnumValuesAreUnique(self):
|
|
26
24
|
"""
|
|
27
|
-
|
|
25
|
+
Test that all TestStatus enum member values are unique.
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
Collects all values from the TestStatus enum and asserts that there are no duplicate values.
|
|
30
28
|
|
|
31
29
|
Returns
|
|
32
30
|
-------
|
|
33
31
|
None
|
|
34
|
-
This method does not return a value. It asserts the uniqueness of enum values.
|
|
35
32
|
"""
|
|
36
33
|
# Gather all enum values
|
|
37
34
|
values = [status.value for status in TestStatus]
|
|
@@ -40,28 +37,26 @@ class TestTestStatus(AsyncTestCase):
|
|
|
40
37
|
|
|
41
38
|
async def testEnumIsInstanceOfEnum(self):
|
|
42
39
|
"""
|
|
43
|
-
|
|
40
|
+
Test that TestStatus is a subclass of Enum.
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
Asserts that TestStatus inherits from the Enum base class.
|
|
46
43
|
|
|
47
44
|
Returns
|
|
48
45
|
-------
|
|
49
46
|
None
|
|
50
|
-
This method does not return a value. It asserts the subclass relationship.
|
|
51
47
|
"""
|
|
52
48
|
# Assert that TestStatus inherits from Enum
|
|
53
49
|
self.assertTrue(issubclass(TestStatus, Enum))
|
|
54
50
|
|
|
55
51
|
async def testEnumMembersType(self):
|
|
56
52
|
"""
|
|
57
|
-
|
|
53
|
+
Test that each member of TestStatus is an instance of TestStatus.
|
|
58
54
|
|
|
59
|
-
|
|
55
|
+
Iterates through all members of TestStatus and asserts their type.
|
|
60
56
|
|
|
61
57
|
Returns
|
|
62
58
|
-------
|
|
63
59
|
None
|
|
64
|
-
This method does not return a value. It asserts the type of each enum member.
|
|
65
60
|
"""
|
|
66
61
|
# Assert that each enum member is an instance of TestStatus
|
|
67
62
|
for status in TestStatus:
|
|
@@ -5,18 +5,15 @@ class TestTestingDumper(AsyncTestCase):
|
|
|
5
5
|
|
|
6
6
|
async def testMethodsExist(self):
|
|
7
7
|
"""
|
|
8
|
-
|
|
8
|
+
Verify the presence of required methods in the TestDumper class.
|
|
9
9
|
|
|
10
|
-
This test
|
|
11
|
-
|
|
12
|
-
each method using `hasattr`.
|
|
10
|
+
This asynchronous test checks whether the TestDumper class implements all methods listed in `required_methods`.
|
|
11
|
+
An assertion error is raised if any required method is missing.
|
|
13
12
|
|
|
14
13
|
Returns
|
|
15
14
|
-------
|
|
16
15
|
None
|
|
17
|
-
This method does not return any value. It raises an assertion error if any required method is missing.
|
|
18
16
|
"""
|
|
19
|
-
|
|
20
17
|
required_methods = [
|
|
21
18
|
"dd",
|
|
22
19
|
"dump"
|
|
@@ -5,20 +5,20 @@ class TestTestingPrinter(AsyncTestCase):
|
|
|
5
5
|
|
|
6
6
|
async def testMethodsExist(self):
|
|
7
7
|
"""
|
|
8
|
-
|
|
8
|
+
Verify that all required methods are present in the TestPrinter class.
|
|
9
9
|
|
|
10
|
-
This test
|
|
11
|
-
|
|
10
|
+
This asynchronous test checks whether each method listed in `required_methods`
|
|
11
|
+
exists as an attribute of the TestPrinter class. An assertion error is raised
|
|
12
|
+
if any required method is missing.
|
|
12
13
|
|
|
13
14
|
Parameters
|
|
14
15
|
----------
|
|
15
16
|
self : TestTestingPrinter
|
|
16
|
-
|
|
17
|
+
Instance of the test case.
|
|
17
18
|
|
|
18
19
|
Returns
|
|
19
20
|
-------
|
|
20
21
|
None
|
|
21
|
-
Raises an AssertionError if any required method is missing.
|
|
22
22
|
"""
|
|
23
23
|
# List of method names that must exist in TestPrinter
|
|
24
24
|
required_methods = [
|
|
@@ -8,17 +8,15 @@ class TestTestingRecords(AsyncTestCase):
|
|
|
8
8
|
|
|
9
9
|
async def testCreateAndGetReport(self):
|
|
10
10
|
"""
|
|
11
|
-
|
|
11
|
+
Test the creation and retrieval of a test report.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Creates a test report with all required fields, stores it using the
|
|
14
|
+
TestLogs class, and retrieves the most recent report to verify its
|
|
15
|
+
contents.
|
|
16
16
|
|
|
17
17
|
Returns
|
|
18
18
|
-------
|
|
19
19
|
None
|
|
20
|
-
This is a test method and does not return any value. Assertions are used
|
|
21
|
-
to validate expected behavior.
|
|
22
20
|
"""
|
|
23
21
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
24
22
|
logs = TestLogs(tmpdir)
|
|
@@ -51,16 +49,14 @@ class TestTestingRecords(AsyncTestCase):
|
|
|
51
49
|
|
|
52
50
|
async def testCreateMissingFields(self):
|
|
53
51
|
"""
|
|
54
|
-
|
|
52
|
+
Test error handling for missing required fields in report creation.
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
Attempts to create a report without the required 'timestamp' field and
|
|
55
|
+
expects an OrionisTestValueError to be raised.
|
|
58
56
|
|
|
59
57
|
Returns
|
|
60
58
|
-------
|
|
61
59
|
None
|
|
62
|
-
This is a test method and does not return any value. Assertions are used
|
|
63
|
-
to validate expected behavior.
|
|
64
60
|
"""
|
|
65
61
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
66
62
|
logs = TestLogs(tmpdir)
|
|
@@ -83,16 +79,14 @@ class TestTestingRecords(AsyncTestCase):
|
|
|
83
79
|
|
|
84
80
|
async def testResetDatabase(self):
|
|
85
81
|
"""
|
|
86
|
-
|
|
82
|
+
Test the reset functionality of the test logs database.
|
|
87
83
|
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
Creates a report, stores it, and then resets the logs database.
|
|
85
|
+
Verifies that the reset operation returns True.
|
|
90
86
|
|
|
91
87
|
Returns
|
|
92
88
|
-------
|
|
93
89
|
None
|
|
94
|
-
This is a test method and does not return any value. Assertions are used
|
|
95
|
-
to validate expected behavior.
|
|
96
90
|
"""
|
|
97
91
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
98
92
|
logs = TestLogs(tmpdir)
|
|
@@ -116,16 +110,14 @@ class TestTestingRecords(AsyncTestCase):
|
|
|
116
110
|
|
|
117
111
|
async def testGetReportsInvalidParams(self):
|
|
118
112
|
"""
|
|
119
|
-
|
|
113
|
+
Test error handling for invalid parameters in TestLogs.get().
|
|
120
114
|
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
Checks that passing mutually exclusive or invalid values to get()
|
|
116
|
+
raises an OrionisTestValueError.
|
|
123
117
|
|
|
124
118
|
Returns
|
|
125
119
|
-------
|
|
126
120
|
None
|
|
127
|
-
This is a test method and does not return any value. Assertions are used
|
|
128
|
-
to validate expected behavior.
|
|
129
121
|
"""
|
|
130
122
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
131
123
|
logs = TestLogs(tmpdir)
|
|
@@ -144,16 +136,14 @@ class TestTestingRecords(AsyncTestCase):
|
|
|
144
136
|
|
|
145
137
|
async def testGetLastReports(self):
|
|
146
138
|
"""
|
|
147
|
-
|
|
139
|
+
Test retrieval of the last N reports and their order.
|
|
148
140
|
|
|
149
|
-
|
|
150
|
-
|
|
141
|
+
Creates multiple reports, retrieves the last two, and checks that the
|
|
142
|
+
reports are returned in descending order by their identifier.
|
|
151
143
|
|
|
152
144
|
Returns
|
|
153
145
|
-------
|
|
154
146
|
None
|
|
155
|
-
This is a test method and does not return any value. Assertions are used
|
|
156
|
-
to validate expected behavior.
|
|
157
147
|
"""
|
|
158
148
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
159
149
|
logs = TestLogs(tmpdir)
|