orionis 0.281.0__py3-none-any.whl → 0.283.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/application.py +2 -7
- orionis/foundation/config/testing/entities/testing.py +9 -0
- orionis/metadata/framework.py +1 -1
- orionis/services/environment/dot_env.py +36 -6
- orionis/services/environment/env.py +4 -4
- orionis/test/entities/test_result.py +7 -0
- orionis/test/logs/__init__.py +0 -0
- orionis/test/logs/contracts/__init__.py +0 -0
- orionis/test/logs/contracts/history.py +81 -0
- orionis/test/logs/history.py +251 -0
- orionis/test/suites/test_suite.py +17 -5
- orionis/test/suites/test_unit.py +63 -15
- orionis/test/view/__init__.py +0 -0
- orionis/test/view/index.html +127 -0
- orionis/unittesting.py +5 -1
- {orionis-0.281.0.dist-info → orionis-0.283.0.dist-info}/METADATA +1 -1
- {orionis-0.281.0.dist-info → orionis-0.283.0.dist-info}/RECORD +22 -16
- tests/services/environment/test_env.py +3 -3
- {orionis-0.281.0.dist-info → orionis-0.283.0.dist-info}/WHEEL +0 -0
- {orionis-0.281.0.dist-info → orionis-0.283.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.281.0.dist-info → orionis-0.283.0.dist-info}/top_level.txt +0 -0
- {orionis-0.281.0.dist-info → orionis-0.283.0.dist-info}/zip-safe +0 -0
orionis/application.py
CHANGED
@@ -1,15 +1,10 @@
|
|
1
1
|
from orionis.foundation.config.startup import Configuration
|
2
|
+
from orionis.patterns.singleton.meta_class import Singleton
|
2
3
|
|
3
|
-
class Orionis:
|
4
|
+
class Orionis(metaclass=Singleton):
|
4
5
|
|
5
6
|
def __init__(
|
6
7
|
self,
|
7
8
|
config: Configuration = None
|
8
9
|
):
|
9
|
-
"""
|
10
|
-
Initializes the Orionis instance with optional configuration objects.
|
11
|
-
|
12
|
-
Args:
|
13
|
-
config (Configuration, optional): Custom application configuration.
|
14
|
-
"""
|
15
10
|
self.__config = config or Configuration()
|
@@ -127,6 +127,15 @@ class Testing:
|
|
127
127
|
}
|
128
128
|
)
|
129
129
|
|
130
|
+
persistent: bool = field(
|
131
|
+
default=False,
|
132
|
+
metadata={
|
133
|
+
"description": "Whether to keep the test results persistent. Default is False.",
|
134
|
+
"required": True,
|
135
|
+
"default": False
|
136
|
+
}
|
137
|
+
)
|
138
|
+
|
130
139
|
def __post_init__(self):
|
131
140
|
"""
|
132
141
|
Post-initialization validation for the testing configuration entity.
|
orionis/metadata/framework.py
CHANGED
@@ -39,7 +39,7 @@ class DotEnv(metaclass=Singleton):
|
|
39
39
|
|
40
40
|
load_dotenv(self._resolved_path)
|
41
41
|
|
42
|
-
def get(self, key: str, default: Optional[Any] = None) -> Any:
|
42
|
+
def get(self, key: str, default: Optional[Any] = None, is_path:bool=False) -> Any:
|
43
43
|
"""
|
44
44
|
Retrieve the value of an environment variable by key.
|
45
45
|
|
@@ -54,6 +54,8 @@ class DotEnv(metaclass=Singleton):
|
|
54
54
|
key (str): The name of the environment variable to retrieve.
|
55
55
|
default (Optional[Any], optional): The value to return if the key is not found.
|
56
56
|
Defaults to None.
|
57
|
+
is_path (bool, optional): If True, the value is treated as a file path and backslashes are replaced with forward slashes.
|
58
|
+
This is useful for Windows paths. Defaults to False.
|
57
59
|
|
58
60
|
Returns:
|
59
61
|
Any: The parsed value of the environment variable, or the default if not found.
|
@@ -62,9 +64,9 @@ class DotEnv(metaclass=Singleton):
|
|
62
64
|
value = dotenv_values(self._resolved_path).get(key)
|
63
65
|
if value is None:
|
64
66
|
value = os.getenv(key)
|
65
|
-
return self.__parseValue(value) if value is not None else default
|
67
|
+
return self.__parseValue(value, is_path) if value is not None else default
|
66
68
|
|
67
|
-
def set(self, key: str, value: Union[str, int, float, bool, list, dict]) -> bool:
|
69
|
+
def set(self, key: str, value: Union[str, int, float, bool, list, dict], is_path:bool=False) -> bool:
|
68
70
|
"""
|
69
71
|
Sets an environment variable with the specified key and value.
|
70
72
|
|
@@ -73,12 +75,15 @@ class DotEnv(metaclass=Singleton):
|
|
73
75
|
Args:
|
74
76
|
key (str): The name of the environment variable to set.
|
75
77
|
value (Union[str, int, float, bool, list, dict]): The value to assign to the environment variable. Supported types include string, integer, float, boolean, list, and dictionary.
|
78
|
+
is_path (bool, optional): If True, the value is treated as a file path and backslashes are replaced with forward slashes.
|
79
|
+
This is useful for Windows paths. Defaults to False.
|
76
80
|
|
77
81
|
Returns:
|
78
82
|
bool: True if the environment variable was successfully set.
|
79
83
|
"""
|
84
|
+
|
80
85
|
with self._lock:
|
81
|
-
serialized_value = self.__serializeValue(value)
|
86
|
+
serialized_value = self.__serializeValue(value, is_path)
|
82
87
|
set_key(str(self._resolved_path), key, serialized_value)
|
83
88
|
os.environ[key] = str(value)
|
84
89
|
return True
|
@@ -133,7 +138,7 @@ class DotEnv(metaclass=Singleton):
|
|
133
138
|
with self._lock:
|
134
139
|
return base64.b64encode(json.dumps(self.all()).encode()).decode()
|
135
140
|
|
136
|
-
def __parseValue(self, value: Any) -> Any:
|
141
|
+
def __parseValue(self, value: Any, is_path:bool=False) -> Any:
|
137
142
|
"""
|
138
143
|
Parses and converts the input value to an appropriate Python data type.
|
139
144
|
|
@@ -151,38 +156,51 @@ class DotEnv(metaclass=Singleton):
|
|
151
156
|
"""
|
152
157
|
if value is None:
|
153
158
|
return None
|
159
|
+
|
154
160
|
if isinstance(value, (bool, int, float)):
|
155
161
|
return value
|
162
|
+
|
156
163
|
value_str = str(value).strip()
|
157
164
|
if not value_str or value_str.lower() in {'none', 'null', 'nan'}:
|
158
165
|
return None
|
166
|
+
|
159
167
|
if value_str.lower() == 'true':
|
160
168
|
return True
|
169
|
+
|
161
170
|
if value_str.lower() == 'false':
|
162
171
|
return False
|
172
|
+
|
173
|
+
if is_path:
|
174
|
+
return value_str.replace("\\", "/")
|
175
|
+
|
163
176
|
try:
|
164
177
|
if value_str.isdigit() or (value_str.startswith('-') and value_str[1:].isdigit()):
|
165
178
|
return int(value_str)
|
166
179
|
except Exception:
|
167
180
|
pass
|
181
|
+
|
168
182
|
try:
|
169
183
|
float_val = float(value_str)
|
170
184
|
if '.' in value_str or 'e' in value_str.lower():
|
171
185
|
return float_val
|
172
186
|
except Exception:
|
173
187
|
pass
|
188
|
+
|
174
189
|
try:
|
175
190
|
return ast.literal_eval(value_str)
|
176
191
|
except Exception:
|
177
192
|
pass
|
193
|
+
|
178
194
|
return value_str
|
179
195
|
|
180
|
-
def __serializeValue(self, value: Any) -> str:
|
196
|
+
def __serializeValue(self, value: Any, is_path:bool=False) -> str:
|
181
197
|
"""
|
182
198
|
Serializes a given value to a string suitable for storage in a .env file.
|
183
199
|
|
184
200
|
Parameters:
|
185
201
|
value (Any): The value to serialize. Supported types are None, str, bool, int, float, list, and dict.
|
202
|
+
is_path (bool): If True, the value is treated as a file path and backslashes are replaced with forward slashes.
|
203
|
+
This is useful for Windows paths.
|
186
204
|
|
187
205
|
Returns:
|
188
206
|
str: The serialized string representation of the value.
|
@@ -191,27 +209,39 @@ class DotEnv(metaclass=Singleton):
|
|
191
209
|
ValueError: If a float value is in scientific notation.
|
192
210
|
TypeError: If the value's type is not serializable for .env files.
|
193
211
|
"""
|
212
|
+
if is_path:
|
213
|
+
return str(value).replace("\\", "/")
|
214
|
+
|
194
215
|
if value is None:
|
195
216
|
return "None"
|
217
|
+
|
196
218
|
if isinstance(value, str):
|
197
219
|
return value
|
220
|
+
|
198
221
|
if isinstance(value, bool):
|
199
222
|
return str(value).lower()
|
223
|
+
|
200
224
|
if isinstance(value, int):
|
201
225
|
return str(value)
|
226
|
+
|
202
227
|
if isinstance(value, float):
|
203
228
|
value = str(value)
|
204
229
|
if 'e' in value or 'E' in value:
|
205
230
|
raise ValueError('scientific notation is not supported, use a string instead')
|
206
231
|
return value
|
232
|
+
|
207
233
|
if isinstance(value, (list, dict)):
|
208
234
|
return repr(value)
|
235
|
+
|
209
236
|
if hasattr(value, '__dict__'):
|
210
237
|
raise TypeError(f"Type {type(value).__name__} is not serializable for .env")
|
238
|
+
|
211
239
|
if not isinstance(value, (list, dict, bool, int, float, str)):
|
212
240
|
raise TypeError(f"Type {type(value).__name__} is not serializable for .env")
|
241
|
+
|
213
242
|
if isinstance(value, (list, dict, bool, int, float, str)):
|
214
243
|
if type(value).__module__ != "builtins" and not isinstance(value, str):
|
215
244
|
raise TypeError(f"Type {type(value).__name__} is not serializable for .env")
|
216
245
|
return repr(value) if not isinstance(value, str) else value
|
246
|
+
|
217
247
|
raise TypeError(f"Type {type(value).__name__} is not serializable for .env")
|
@@ -24,18 +24,18 @@ class Env(IEnv):
|
|
24
24
|
return cls._dotenv_instance
|
25
25
|
|
26
26
|
@staticmethod
|
27
|
-
def get(key: str, default: Any = None) -> Any:
|
27
|
+
def get(key: str, default: Any = None, is_path: bool = False) -> Any:
|
28
28
|
"""
|
29
29
|
Retrieve the value of an environment variable by key.
|
30
30
|
"""
|
31
|
-
return Env._dotenv().get(key, default)
|
31
|
+
return Env._dotenv().get(key, default, is_path)
|
32
32
|
|
33
33
|
@staticmethod
|
34
|
-
def set(key: str, value: str) -> bool:
|
34
|
+
def set(key: str, value: str, is_path: bool = False) -> bool:
|
35
35
|
"""
|
36
36
|
Sets the value of an environment variable.
|
37
37
|
"""
|
38
|
-
return Env._dotenv().set(key, value)
|
38
|
+
return Env._dotenv().set(key, value, is_path)
|
39
39
|
|
40
40
|
@staticmethod
|
41
41
|
def unset(key: str) -> bool:
|
File without changes
|
File without changes
|
@@ -0,0 +1,81 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Dict, List, Tuple
|
3
|
+
|
4
|
+
class ITestHistory(ABC):
|
5
|
+
|
6
|
+
@abstractmethod
|
7
|
+
def createTableIfNotExists(self) -> None:
|
8
|
+
"""
|
9
|
+
Create the 'reportes' table if it does not already exist.
|
10
|
+
|
11
|
+
The table includes fields for the full JSON report and individual
|
12
|
+
statistics for querying and filtering.
|
13
|
+
|
14
|
+
Raises
|
15
|
+
------
|
16
|
+
RuntimeError
|
17
|
+
If table creation fails due to a database error.
|
18
|
+
"""
|
19
|
+
pass
|
20
|
+
|
21
|
+
@abstractmethod
|
22
|
+
def insertReport(self, report: Dict) -> None:
|
23
|
+
"""
|
24
|
+
Insert a test report into the database.
|
25
|
+
|
26
|
+
Parameters
|
27
|
+
----------
|
28
|
+
report : dict
|
29
|
+
Dictionary containing test statistics and metadata.
|
30
|
+
|
31
|
+
Required keys:
|
32
|
+
- total_tests : int
|
33
|
+
- passed : int
|
34
|
+
- failed : int
|
35
|
+
- errors : int
|
36
|
+
- skipped : int
|
37
|
+
- total_time : float
|
38
|
+
- success_rate : float
|
39
|
+
- timestamp : str (ISO format)
|
40
|
+
|
41
|
+
Raises
|
42
|
+
------
|
43
|
+
ValueError
|
44
|
+
If required keys are missing from the report.
|
45
|
+
RuntimeError
|
46
|
+
If insertion into the database fails.
|
47
|
+
"""
|
48
|
+
pass
|
49
|
+
|
50
|
+
def getReports(self) -> List[Tuple]:
|
51
|
+
"""
|
52
|
+
Retrieve all test reports from the database.
|
53
|
+
|
54
|
+
Returns
|
55
|
+
-------
|
56
|
+
List[Tuple]
|
57
|
+
A list of tuples representing each row in the `reportes` table.
|
58
|
+
|
59
|
+
Raises
|
60
|
+
------
|
61
|
+
RuntimeError
|
62
|
+
If retrieval fails due to a database error.
|
63
|
+
"""
|
64
|
+
pass
|
65
|
+
|
66
|
+
def resetDatabase(self) -> None:
|
67
|
+
"""
|
68
|
+
Drop the `reportes` table, effectively clearing the report history.
|
69
|
+
|
70
|
+
Raises
|
71
|
+
------
|
72
|
+
RuntimeError
|
73
|
+
If table deletion fails.
|
74
|
+
"""
|
75
|
+
pass
|
76
|
+
|
77
|
+
def close(self) -> None:
|
78
|
+
"""
|
79
|
+
Close the SQLite database connection gracefully.
|
80
|
+
"""
|
81
|
+
pass
|
@@ -0,0 +1,251 @@
|
|
1
|
+
import json
|
2
|
+
import sqlite3
|
3
|
+
from pathlib import Path
|
4
|
+
from typing import Dict, List, Tuple, Optional
|
5
|
+
from contextlib import closing
|
6
|
+
from orionis.services.environment.env import Env
|
7
|
+
from orionis.test.logs.contracts.history import ITestHistory
|
8
|
+
|
9
|
+
class TestHistory(ITestHistory):
|
10
|
+
"""
|
11
|
+
A utility class for managing test execution reports using a local SQLite database.
|
12
|
+
|
13
|
+
Attributes
|
14
|
+
----------
|
15
|
+
TABLE_NAME : str
|
16
|
+
The name of the database table where reports are stored.
|
17
|
+
DB_NAME : str
|
18
|
+
The filename of the SQLite database.
|
19
|
+
FIELDS : List[str]
|
20
|
+
List of expected keys in the report dictionary.
|
21
|
+
_conn : sqlite3.Connection or None
|
22
|
+
SQLite database connection instance.
|
23
|
+
"""
|
24
|
+
|
25
|
+
TABLE_NAME = "reportes"
|
26
|
+
DB_NAME = "tests.sqlite"
|
27
|
+
FIELDS = [
|
28
|
+
"json", "total_tests", "passed", "failed", "errors",
|
29
|
+
"skipped", "total_time", "success_rate", "timestamp"
|
30
|
+
]
|
31
|
+
|
32
|
+
def __init__(self, test_db_path: Optional[str] = None) -> None:
|
33
|
+
"""
|
34
|
+
Initializes the class instance, setting up the path to the test database.
|
35
|
+
Parameters:
|
36
|
+
test_db_path (Optional[str]): Optional path to the test database file or directory. If a directory is provided, the database file name is appended. If not provided, the method checks the 'TEST_DB_PATH' environment variable, or defaults to a database file in the current file's directory.
|
37
|
+
Behavior:
|
38
|
+
- Resolves the database path to an absolute path.
|
39
|
+
- Ensures the parent directory for the database exists.
|
40
|
+
- Stores the resolved database path in the 'TEST_DB_PATH' environment variable.
|
41
|
+
- Prepares the instance for database connection initialization.
|
42
|
+
"""
|
43
|
+
|
44
|
+
if test_db_path:
|
45
|
+
|
46
|
+
# Resolve the provided test_db_path to an absolute path
|
47
|
+
db_path = Path(test_db_path).resolve()
|
48
|
+
|
49
|
+
# If the provided path is a directory, append the database name
|
50
|
+
if db_path.is_dir():
|
51
|
+
db_path = db_path / self.DB_NAME
|
52
|
+
|
53
|
+
else:
|
54
|
+
|
55
|
+
# Check if the TEST_DB_PATH environment variable is set
|
56
|
+
env_path = Env.get(
|
57
|
+
key="TEST_DB_PATH",
|
58
|
+
default=None,
|
59
|
+
is_path=True
|
60
|
+
)
|
61
|
+
|
62
|
+
# If the environment variable is set, resolve it to an absolute path
|
63
|
+
if env_path:
|
64
|
+
db_path = Path(env_path).resolve()
|
65
|
+
if db_path.is_dir():
|
66
|
+
db_path = db_path / self.DB_NAME
|
67
|
+
else:
|
68
|
+
db_path = Path(__file__).parent / self.DB_NAME
|
69
|
+
|
70
|
+
# Ensure directory exists
|
71
|
+
db_path.parent.mkdir(parents=True, exist_ok=True)
|
72
|
+
|
73
|
+
# Store the absolute string path in the environment
|
74
|
+
Env.set(
|
75
|
+
key="TEST_DB_PATH",
|
76
|
+
value=str(db_path),
|
77
|
+
is_path=True
|
78
|
+
)
|
79
|
+
|
80
|
+
# Initialize the database connection.
|
81
|
+
self._conn: Optional[sqlite3.Connection] = None
|
82
|
+
|
83
|
+
def __connect(self) -> None:
|
84
|
+
"""
|
85
|
+
Establishes a connection to the SQLite database using the path specified in the
|
86
|
+
'TEST_DB_PATH' environment variable. If the environment variable is not set,
|
87
|
+
raises a ConnectionError. If a connection error occurs during the attempt to
|
88
|
+
connect, raises a ConnectionError with the error details.
|
89
|
+
Raises:
|
90
|
+
ConnectionError: If the database path is not set or if a connection error occurs.
|
91
|
+
"""
|
92
|
+
|
93
|
+
if self._conn is None:
|
94
|
+
|
95
|
+
# Check if the TEST_DB_PATH environment variable is set
|
96
|
+
db_path = Env.get(
|
97
|
+
key="TEST_DB_PATH",
|
98
|
+
default=None,
|
99
|
+
is_path=True
|
100
|
+
)
|
101
|
+
|
102
|
+
# If not set, raise an error
|
103
|
+
if not db_path:
|
104
|
+
raise ConnectionError("Database path is not set in environment variables.")
|
105
|
+
|
106
|
+
# Try to connect to the SQLite database
|
107
|
+
try:
|
108
|
+
self._conn = sqlite3.connect(db_path)
|
109
|
+
except sqlite3.Error as e:
|
110
|
+
raise ConnectionError(f"Database connection error: {e}")
|
111
|
+
|
112
|
+
def createTableIfNotExists(self) -> None:
|
113
|
+
"""
|
114
|
+
Creates the history table in the database if it does not already exist.
|
115
|
+
This method establishes a connection to the database and attempts to create a table
|
116
|
+
with the schema defined by `self.TABLE_NAME`. The table includes columns for test
|
117
|
+
results and metadata such as total tests, passed, failed, errors, skipped, total time,
|
118
|
+
success rate, and timestamp. If the table already exists, no changes are made.
|
119
|
+
Raises a RuntimeError if the table creation fails due to a database error.
|
120
|
+
"""
|
121
|
+
|
122
|
+
self.__connect()
|
123
|
+
try:
|
124
|
+
with closing(self._conn.cursor()) as cursor:
|
125
|
+
cursor.execute(f'''
|
126
|
+
CREATE TABLE IF NOT EXISTS {self.TABLE_NAME} (
|
127
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
128
|
+
json TEXT NOT NULL,
|
129
|
+
total_tests INTEGER,
|
130
|
+
passed INTEGER,
|
131
|
+
failed INTEGER,
|
132
|
+
errors INTEGER,
|
133
|
+
skipped INTEGER,
|
134
|
+
total_time REAL,
|
135
|
+
success_rate REAL,
|
136
|
+
timestamp TEXT
|
137
|
+
)
|
138
|
+
''')
|
139
|
+
self._conn.commit()
|
140
|
+
except sqlite3.Error as e:
|
141
|
+
raise RuntimeError(f"Failed to create table: {e}")
|
142
|
+
|
143
|
+
def insertReport(self, report: Dict) -> None:
|
144
|
+
"""
|
145
|
+
Inserts a test report into the database.
|
146
|
+
Args:
|
147
|
+
report (Dict): A dictionary containing the report data. Must include the following keys:
|
148
|
+
- total_tests
|
149
|
+
- passed
|
150
|
+
- failed
|
151
|
+
- errors
|
152
|
+
- skipped
|
153
|
+
- total_time
|
154
|
+
- success_rate
|
155
|
+
- timestamp
|
156
|
+
Raises:
|
157
|
+
ValueError: If any required report fields are missing.
|
158
|
+
RuntimeError: If there is an error inserting the report into the database.
|
159
|
+
"""
|
160
|
+
|
161
|
+
self.__connect()
|
162
|
+
missing = [key for key in self.FIELDS if key != "json" and key not in report]
|
163
|
+
if missing:
|
164
|
+
raise ValueError(f"Missing report fields: {missing}")
|
165
|
+
|
166
|
+
try:
|
167
|
+
with closing(self._conn.cursor()) as cursor:
|
168
|
+
cursor.execute(f'''
|
169
|
+
INSERT INTO {self.TABLE_NAME} (
|
170
|
+
json, total_tests, passed, failed, errors,
|
171
|
+
skipped, total_time, success_rate, timestamp
|
172
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
173
|
+
''', (
|
174
|
+
json.dumps(report),
|
175
|
+
report["total_tests"],
|
176
|
+
report["passed"],
|
177
|
+
report["failed"],
|
178
|
+
report["errors"],
|
179
|
+
report["skipped"],
|
180
|
+
report["total_time"],
|
181
|
+
report["success_rate"],
|
182
|
+
report["timestamp"]
|
183
|
+
))
|
184
|
+
self._conn.commit()
|
185
|
+
except sqlite3.Error as e:
|
186
|
+
raise RuntimeError(f"Failed to insert report: {e}")
|
187
|
+
|
188
|
+
def getReportsWhere(self, where: Optional[str] = None, params: Optional[Tuple] = None) -> List[Tuple]:
|
189
|
+
"""
|
190
|
+
Retrieves reports from the database table with optional WHERE conditions.
|
191
|
+
Args:
|
192
|
+
where (Optional[str]): SQL WHERE clause (without the 'WHERE' keyword).
|
193
|
+
params (Optional[Tuple]): Parameters to substitute in the WHERE clause.
|
194
|
+
Returns:
|
195
|
+
List[Tuple]: A list of tuples, each representing a row from the reports table.
|
196
|
+
Raises:
|
197
|
+
RuntimeError: If there is an error retrieving the reports from the database.
|
198
|
+
"""
|
199
|
+
self.__connect()
|
200
|
+
try:
|
201
|
+
with closing(self._conn.cursor()) as cursor:
|
202
|
+
query = f'SELECT * FROM {self.TABLE_NAME}'
|
203
|
+
if where:
|
204
|
+
query += f' WHERE {where}'
|
205
|
+
cursor.execute(query, params or ())
|
206
|
+
return cursor.fetchall()
|
207
|
+
except sqlite3.Error as e:
|
208
|
+
raise RuntimeError(f"Failed to retrieve reports: {e}")
|
209
|
+
|
210
|
+
def getReports(self) -> List[Tuple]:
|
211
|
+
"""
|
212
|
+
Retrieves all reports from the database table.
|
213
|
+
Returns:
|
214
|
+
List[Tuple]: A list of tuples, each representing a row from the reports table.
|
215
|
+
Raises:
|
216
|
+
RuntimeError: If there is an error retrieving the reports from the database.
|
217
|
+
"""
|
218
|
+
|
219
|
+
self.__connect()
|
220
|
+
try:
|
221
|
+
with closing(self._conn.cursor()) as cursor:
|
222
|
+
cursor.execute(f'SELECT * FROM {self.TABLE_NAME}')
|
223
|
+
return cursor.fetchall()
|
224
|
+
except sqlite3.Error as e:
|
225
|
+
raise RuntimeError(f"Failed to retrieve reports: {e}")
|
226
|
+
|
227
|
+
def resetDatabase(self) -> None:
|
228
|
+
"""
|
229
|
+
Resets the database by dropping the table specified by TABLE_NAME if it exists.
|
230
|
+
This method establishes a connection to the database, attempts to drop the table,
|
231
|
+
and commits the changes. If an error occurs during the process, a RuntimeError is raised.
|
232
|
+
Raises:
|
233
|
+
RuntimeError: If the database reset operation fails.
|
234
|
+
"""
|
235
|
+
|
236
|
+
self.__connect()
|
237
|
+
try:
|
238
|
+
with closing(self._conn.cursor()) as cursor:
|
239
|
+
cursor.execute(f'DROP TABLE IF EXISTS {self.TABLE_NAME}')
|
240
|
+
self._conn.commit()
|
241
|
+
except sqlite3.Error as e:
|
242
|
+
raise RuntimeError(f"Failed to reset database: {e}")
|
243
|
+
|
244
|
+
def close(self) -> None:
|
245
|
+
"""
|
246
|
+
Closes the current database connection if it exists and sets the connection attribute to None.
|
247
|
+
"""
|
248
|
+
|
249
|
+
if self._conn:
|
250
|
+
self._conn.close()
|
251
|
+
self._conn = None
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import re
|
2
2
|
from os import walk
|
3
3
|
from orionis.foundation.config.testing.entities.testing import Testing as Configuration
|
4
|
+
from orionis.test.exceptions.test_config_exception import OrionisTestConfigException
|
4
5
|
from orionis.test.suites.contracts.test_suite import ITestSuite
|
5
6
|
from orionis.test.suites.test_unit import UnitTest
|
6
|
-
from orionis.test.exceptions.test_config_exception import OrionisTestConfigException
|
7
7
|
|
8
8
|
class TestSuite(ITestSuite):
|
9
9
|
"""
|
@@ -27,7 +27,8 @@ class TestSuite(ITestSuite):
|
|
27
27
|
Attributes:
|
28
28
|
_config (Configuration): The configuration used by the object. If no configuration is provided, a new Configuration instance is created.
|
29
29
|
"""
|
30
|
-
self.
|
30
|
+
self.__config = config or Configuration()
|
31
|
+
self.__result = None
|
31
32
|
|
32
33
|
def run(self) -> UnitTest:
|
33
34
|
"""
|
@@ -42,7 +43,7 @@ class TestSuite(ITestSuite):
|
|
42
43
|
"""
|
43
44
|
|
44
45
|
# Check if the config is provided
|
45
|
-
config = self.
|
46
|
+
config = self.__config
|
46
47
|
|
47
48
|
# Check if the config is an instance of Configuration
|
48
49
|
if not isinstance(config, Configuration):
|
@@ -58,7 +59,8 @@ class TestSuite(ITestSuite):
|
|
58
59
|
max_workers=config.max_workers,
|
59
60
|
fail_fast=config.fail_fast,
|
60
61
|
print_result=config.print_result,
|
61
|
-
throw_exception=config.throw_exception
|
62
|
+
throw_exception=config.throw_exception,
|
63
|
+
persistent=config.persistent,
|
62
64
|
)
|
63
65
|
|
64
66
|
# Extract configuration values
|
@@ -98,4 +100,14 @@ class TestSuite(ITestSuite):
|
|
98
100
|
)
|
99
101
|
|
100
102
|
# Return the initialized test suite
|
101
|
-
|
103
|
+
self.__result = tests.run()
|
104
|
+
return self.__result
|
105
|
+
|
106
|
+
def getResult(self) -> UnitTest:
|
107
|
+
"""
|
108
|
+
Returns the results of the executed test suite.
|
109
|
+
|
110
|
+
Returns:
|
111
|
+
UnitTest: The result of the executed test suite.
|
112
|
+
"""
|
113
|
+
return self.__result
|
orionis/test/suites/test_unit.py
CHANGED
@@ -14,12 +14,14 @@ from rich.panel import Panel
|
|
14
14
|
from rich.syntax import Syntax
|
15
15
|
from rich.table import Table
|
16
16
|
from orionis.console.output.console import Console
|
17
|
+
from orionis.test.logs.history import TestHistory
|
17
18
|
from orionis.test.suites.contracts.test_unit import IUnitTest
|
18
19
|
from orionis.test.entities.test_result import TestResult
|
19
20
|
from orionis.test.enums.test_mode import ExecutionMode
|
20
21
|
from orionis.test.enums.test_status import TestStatus
|
21
22
|
from orionis.test.exceptions.test_failure_exception import OrionisTestFailureException
|
22
23
|
from rich.live import Live
|
24
|
+
import os
|
23
25
|
|
24
26
|
class UnitTest(IUnitTest):
|
25
27
|
"""
|
@@ -64,6 +66,8 @@ class UnitTest(IUnitTest):
|
|
64
66
|
self.discovered_tests: List = []
|
65
67
|
self.width_output_component: int = int(self.rich_console.width * 0.75)
|
66
68
|
self.throw_exception: bool = False
|
69
|
+
self.persistent: bool = False
|
70
|
+
self.base_path: str = "tests"
|
67
71
|
|
68
72
|
def configure(
|
69
73
|
self,
|
@@ -72,7 +76,8 @@ class UnitTest(IUnitTest):
|
|
72
76
|
max_workers: int = None,
|
73
77
|
fail_fast: bool = None,
|
74
78
|
print_result: bool = None,
|
75
|
-
throw_exception: bool = False
|
79
|
+
throw_exception: bool = False,
|
80
|
+
persistent: bool = False
|
76
81
|
) -> 'UnitTest':
|
77
82
|
"""
|
78
83
|
Configures the UnitTest instance with the specified parameters.
|
@@ -83,6 +88,8 @@ class UnitTest(IUnitTest):
|
|
83
88
|
max_workers (int, optional): The maximum number of workers to use for parallel execution. Defaults to None.
|
84
89
|
fail_fast (bool, optional): Whether to stop execution upon the first failure. Defaults to None.
|
85
90
|
print_result (bool, optional): Whether to print the test results after execution. Defaults to None.
|
91
|
+
throw_exception (bool, optional): Whether to throw an exception if any test fails. Defaults to False.
|
92
|
+
persistent (bool, optional): Whether to persist the test results in a database. Defaults to False.
|
86
93
|
|
87
94
|
Returns:
|
88
95
|
UnitTest: The configured UnitTest instance.
|
@@ -107,6 +114,9 @@ class UnitTest(IUnitTest):
|
|
107
114
|
if throw_exception is not None:
|
108
115
|
self.throw_exception = throw_exception
|
109
116
|
|
117
|
+
if persistent is not None:
|
118
|
+
self.persistent = persistent
|
119
|
+
|
110
120
|
return self
|
111
121
|
|
112
122
|
def discoverTestsInFolder(
|
@@ -131,6 +141,8 @@ class UnitTest(IUnitTest):
|
|
131
141
|
ValueError: If the test folder does not exist, no tests are found, or an error occurs during test discovery.
|
132
142
|
"""
|
133
143
|
try:
|
144
|
+
self.base_path = base_path
|
145
|
+
|
134
146
|
full_path = Path(base_path) / folder_path
|
135
147
|
if not full_path.exists():
|
136
148
|
raise ValueError(f"Test folder not found: {full_path}")
|
@@ -290,9 +302,6 @@ class UnitTest(IUnitTest):
|
|
290
302
|
if self.print_result:
|
291
303
|
self._displayResults(summary, result)
|
292
304
|
|
293
|
-
# Generate performance report
|
294
|
-
summary["timestamp"] = datetime.now().isoformat()
|
295
|
-
|
296
305
|
# Print Execution Time
|
297
306
|
if not result.wasSuccessful() and self.throw_exception:
|
298
307
|
raise OrionisTestFailureException(result)
|
@@ -446,6 +455,7 @@ class UnitTest(IUnitTest):
|
|
446
455
|
method=getattr(test, "_testMethodName", None),
|
447
456
|
module=getattr(test, "__module__", None),
|
448
457
|
file_path=inspect.getfile(test.__class__),
|
458
|
+
doc_string=getattr(getattr(test, test._testMethodName, None), "__doc__", None),
|
449
459
|
)
|
450
460
|
)
|
451
461
|
|
@@ -466,6 +476,7 @@ class UnitTest(IUnitTest):
|
|
466
476
|
method=getattr(test, "_testMethodName", None),
|
467
477
|
module=getattr(test, "__module__", None),
|
468
478
|
file_path=inspect.getfile(test.__class__),
|
479
|
+
doc_string=getattr(getattr(test, test._testMethodName, None), "__doc__", None),
|
469
480
|
)
|
470
481
|
)
|
471
482
|
|
@@ -486,6 +497,7 @@ class UnitTest(IUnitTest):
|
|
486
497
|
method=getattr(test, "_testMethodName", None),
|
487
498
|
module=getattr(test, "__module__", None),
|
488
499
|
file_path=inspect.getfile(test.__class__),
|
500
|
+
doc_string=getattr(getattr(test, test._testMethodName, None), "__doc__", None),
|
489
501
|
)
|
490
502
|
)
|
491
503
|
|
@@ -503,6 +515,7 @@ class UnitTest(IUnitTest):
|
|
503
515
|
method=getattr(test, "_testMethodName", None),
|
504
516
|
module=getattr(test, "__module__", None),
|
505
517
|
file_path=inspect.getfile(test.__class__),
|
518
|
+
doc_string=getattr(getattr(test, test._testMethodName, None), "__doc__", None),
|
506
519
|
)
|
507
520
|
)
|
508
521
|
|
@@ -533,11 +546,8 @@ class UnitTest(IUnitTest):
|
|
533
546
|
- "error_message" (str): The error message if the test failed or errored.
|
534
547
|
- "traceback" (str): The traceback information if the test failed or errored.
|
535
548
|
- "file_path" (str): The file path of the test.
|
536
|
-
- "performance_data" (List[Dict[str, float]]): A list containing performance data:
|
537
|
-
- "duration" (float): The total execution time of the test suite.
|
538
549
|
"""
|
539
550
|
test_details = []
|
540
|
-
performance_data = []
|
541
551
|
|
542
552
|
for test_result in result.test_results:
|
543
553
|
rst: TestResult = test_result
|
@@ -549,28 +559,66 @@ class UnitTest(IUnitTest):
|
|
549
559
|
'execution_time': float(rst.execution_time),
|
550
560
|
'error_message': rst.error_message,
|
551
561
|
'traceback': rst.traceback,
|
552
|
-
'file_path': rst.file_path
|
562
|
+
'file_path': rst.file_path,
|
563
|
+
'doc_string': rst.doc_string
|
553
564
|
})
|
554
565
|
|
555
|
-
performance_data.append({
|
556
|
-
'duration': float(execution_time)
|
557
|
-
})
|
558
|
-
|
559
566
|
passed = result.testsRun - len(result.failures) - len(result.errors) - len(result.skipped)
|
560
567
|
success_rate = (passed / result.testsRun * 100) if result.testsRun > 0 else 100.0
|
561
568
|
|
562
|
-
|
569
|
+
# Create a summary report
|
570
|
+
report = {
|
563
571
|
"total_tests": result.testsRun,
|
564
572
|
"passed": passed,
|
565
573
|
"failed": len(result.failures),
|
566
574
|
"errors": len(result.errors),
|
567
575
|
"skipped": len(result.skipped),
|
568
|
-
"total_time": execution_time,
|
576
|
+
"total_time": float(execution_time),
|
569
577
|
"success_rate": success_rate,
|
570
578
|
"test_details": test_details,
|
571
|
-
"
|
579
|
+
"timestamp": datetime.now().isoformat()
|
580
|
+
}
|
581
|
+
|
582
|
+
# Handle persistence of the report
|
583
|
+
if self.persistent:
|
584
|
+
self._persistTestResults(report)
|
585
|
+
|
586
|
+
# Return the summary
|
587
|
+
return {
|
588
|
+
"total_tests": result.testsRun,
|
589
|
+
"passed": passed,
|
590
|
+
"failed": len(result.failures),
|
591
|
+
"errors": len(result.errors),
|
592
|
+
"skipped": len(result.skipped),
|
593
|
+
"total_time": float(execution_time),
|
594
|
+
"success_rate": success_rate,
|
595
|
+
"test_details": test_details
|
572
596
|
}
|
573
597
|
|
598
|
+
def _persistTestResults(self, summary: Dict[str, Any]) -> None:
|
599
|
+
"""
|
600
|
+
Persists the test results in a SQLite database.
|
601
|
+
Args:
|
602
|
+
summary (Dict[str, Any]): A dictionary containing the test summary data.
|
603
|
+
Expected keys in the dictionary:
|
604
|
+
- "total_tests" (int): Total number of tests executed.
|
605
|
+
- "passed" (int): Number of tests that passed.
|
606
|
+
- "failed" (int): Number of tests that failed.
|
607
|
+
- "errors" (int): Number of tests that encountered errors.
|
608
|
+
- "skipped" (int): Number of tests that were skipped.
|
609
|
+
- "total_time" (float): Total duration of the test run in seconds.
|
610
|
+
- "success_rate" (float): Percentage of tests that passed.
|
611
|
+
Returns:
|
612
|
+
None
|
613
|
+
"""
|
614
|
+
full_path = os.path.abspath(os.path.join(os.getcwd(), self.base_path))
|
615
|
+
log = TestHistory(full_path)
|
616
|
+
try:
|
617
|
+
log.createTableIfNotExists()
|
618
|
+
log.insertReport(summary)
|
619
|
+
finally:
|
620
|
+
log.close()
|
621
|
+
|
574
622
|
def _printSummaryTable(self, summary: Dict[str, Any]) -> None:
|
575
623
|
"""
|
576
624
|
Prints a summary table of test results using the Rich library.
|
File without changes
|
@@ -0,0 +1,127 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8" />
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
|
+
<title>Orionis Test Dashboard</title>
|
8
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
9
|
+
<link rel="icon" href="https://orionis-framework.com/svg/logo.svg" />
|
10
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
11
|
+
</head>
|
12
|
+
|
13
|
+
<body class="bg-gray-100 text-gray-800 font-sans">
|
14
|
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 py-8">
|
15
|
+
|
16
|
+
<!-- Header -->
|
17
|
+
<header class="bg-gradient-to-r from-blue-900 to-cyan-400 text-white rounded-2xl shadow-xl p-6 mb-10">
|
18
|
+
<div class="flex flex-col md:flex-row justify-between items-center gap-4">
|
19
|
+
<div class="flex items-center gap-4">
|
20
|
+
<img src="https://orionis-framework.com/svg/logo.svg" alt="Orionis Logo"
|
21
|
+
class="h-10 brightness-0 invert" />
|
22
|
+
<h1 class="text-2xl font-light tracking-wider">Orionis Testing Results Dashboard</h1>
|
23
|
+
</div>
|
24
|
+
<div id="timestamp" class="text-sm text-white/90"></div>
|
25
|
+
</header>
|
26
|
+
|
27
|
+
<!-- Execution Summary Card -->
|
28
|
+
<div class="w-full mb-10">
|
29
|
+
<div class="bg-white rounded-2xl shadow-lg p-6 border-t-4 border-indigo-500 flex flex-col sm:flex-row items-center justify-between gap-4">
|
30
|
+
<div>
|
31
|
+
<div class="text-xs font-semibold text-gray-500 uppercase">Resumen de Ejecución</div>
|
32
|
+
<div class="text-lg font-bold text-gray-800 mt-2" id="execution-summary-title">Ejecución Completa</div>
|
33
|
+
<div class="text-sm text-gray-600 mt-1" id="execution-summary-desc">Todos los tests han sido ejecutados correctamente.</div>
|
34
|
+
</div>
|
35
|
+
<div class="flex items-center gap-4">
|
36
|
+
<div class="flex items-center gap-1 text-gray-700">
|
37
|
+
<i class="bi bi-clock-history text-xl text-indigo-500"></i>
|
38
|
+
<span id="execution-time">Duración: 00:00:00</span>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<!-- Summary Cards -->
|
45
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6 mb-10">
|
46
|
+
|
47
|
+
<div class="bg-white rounded-2xl shadow-lg p-6 border-t-4 border-green-500">
|
48
|
+
<div class="text-xs font-semibold text-gray-500 uppercase">Passed</div>
|
49
|
+
<div class="text-4xl font-bold text-gray-800 mt-2" id="passed">0</div>
|
50
|
+
<div class="mt-4 bg-gray-200 rounded-full h-2">
|
51
|
+
<div class="bg-green-500 h-2 rounded-full" id="passed-progress" style="width: 0%"></div>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<div class="bg-white rounded-2xl shadow-lg p-6 border-t-4 border-red-500">
|
56
|
+
<div class="text-xs font-semibold text-gray-500 uppercase">Failed</div>
|
57
|
+
<div class="text-4xl font-bold text-gray-800 mt-2" id="failed">0</div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="bg-white rounded-2xl shadow-lg p-6 border-t-4 border-yellow-500">
|
61
|
+
<div class="text-xs font-semibold text-gray-500 uppercase">Errors</div>
|
62
|
+
<div class="text-4xl font-bold text-gray-800 mt-2" id="errors">0</div>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div class="bg-white rounded-2xl shadow-lg p-6 border-t-4 border-blue-500">
|
66
|
+
<div class="text-xs font-semibold text-gray-500 uppercase">Skipped</div>
|
67
|
+
<div class="text-4xl font-bold text-gray-800 mt-2" id="skipped">0</div>
|
68
|
+
</div>
|
69
|
+
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<!-- Download Buttons & Select -->
|
73
|
+
<div class="flex flex-wrap justify-between items-center mb-10 gap-4">
|
74
|
+
<!-- Buttons to the left -->
|
75
|
+
<div class="flex flex-wrap gap-4">
|
76
|
+
<button id="download-json"
|
77
|
+
class="flex items-center gap-2 bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded shadow">
|
78
|
+
<i class="bi bi-file-earmark-code-fill text-lg"></i>
|
79
|
+
<span>Download JSON</span>
|
80
|
+
</button>
|
81
|
+
<button id="download-excel"
|
82
|
+
class="flex items-center gap-2 bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded shadow">
|
83
|
+
<i class="bi bi-file-earmark-excel-fill text-lg"></i>
|
84
|
+
<span>Download Excel</span>
|
85
|
+
</button>
|
86
|
+
<button id="download-pdf"
|
87
|
+
class="flex items-center gap-2 bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded shadow">
|
88
|
+
<i class="bi bi-file-earmark-pdf-fill text-lg"></i>
|
89
|
+
<span>Download PDF</span>
|
90
|
+
</button>
|
91
|
+
</div>
|
92
|
+
<!-- Elegant Select to the right -->
|
93
|
+
<div>
|
94
|
+
<select
|
95
|
+
class="appearance-none bg-white border border-gray-300 text-gray-700 py-2 px-4 pr-10 rounded-lg shadow focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-blue-400 transition text-base font-medium">
|
96
|
+
<option selected disabled>Selecciona una opción</option>
|
97
|
+
<option>Opción 1</option>
|
98
|
+
<option>Opción 2</option>
|
99
|
+
<option>Opción 3</option>
|
100
|
+
</select>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<!-- JSON Viewer Panel -->
|
105
|
+
<div class="bg-white rounded-2xl shadow-xl p-6">
|
106
|
+
<h2 class="text-xl font-semibold mb-4">Test Report JSON</h2>
|
107
|
+
<pre id="json-data"
|
108
|
+
class="whitespace-pre-wrap text-sm text-gray-800 bg-gray-100 p-4 rounded-xl overflow-x-auto"></pre>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<!-- Footer -->
|
112
|
+
<footer class="mt-12 text-center text-gray-500 text-sm py-6">
|
113
|
+
Developed with the power of
|
114
|
+
<a href="https://orionis-framework.com/" target="_blank" rel="noopener"
|
115
|
+
class="font-semibold text-blue-700 hover:underline">
|
116
|
+
Orionis Framework
|
117
|
+
</a>
|
118
|
+
<i class="bi bi-stars text-yellow-400 align-middle ml-1"></i>
|
119
|
+
</footer>
|
120
|
+
|
121
|
+
<script>
|
122
|
+
// Placeholder JS logic
|
123
|
+
document.getElementById("timestamp").textContent = new Date().toLocaleString();
|
124
|
+
</script>
|
125
|
+
</body>
|
126
|
+
|
127
|
+
</html>
|
orionis/unittesting.py
CHANGED
@@ -3,6 +3,9 @@ from orionis.test.cases.test_case import TestCase
|
|
3
3
|
from orionis.test.cases.test_sync import SyncTestCase
|
4
4
|
from orionis.test.cases.test_async import AsyncTestCase
|
5
5
|
|
6
|
+
# Import the custom TestHistory class for logging test results
|
7
|
+
from orionis.test.logs.history import TestHistory
|
8
|
+
|
6
9
|
# Import the custom TestResult entity
|
7
10
|
from orionis.test.entities.test_result import TestResult
|
8
11
|
|
@@ -48,5 +51,6 @@ __all__ = [
|
|
48
51
|
"UnittestTestResult",
|
49
52
|
"UnittestMock",
|
50
53
|
"UnittestMagicMock",
|
54
|
+
"TestHistory",
|
51
55
|
"unittest_mock_patch",
|
52
|
-
]
|
56
|
+
]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
orionis/_application.py,sha256=dMjJ0nFcIIOBGb5zr-tHNzcgTOZ1vJ7iMdFAlqSQph0,9405
|
3
|
-
orionis/application.py,sha256=
|
4
|
-
orionis/unittesting.py,sha256=
|
3
|
+
orionis/application.py,sha256=Off5uOUj-IYvvR8DcqLUoBW_98opWa7MQrtqTr0SZGc,292
|
4
|
+
orionis/unittesting.py,sha256=am9rM3IcnG5NP_jA1Bj-VxjBGRTb0tGcehfkt9OoKGU,1761
|
5
5
|
orionis/_container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
orionis/_container/container.py,sha256=0AOqTNwpN_OtWbq9mBI99qfJ7LMkN71y0lP0JWKzut0,18289
|
7
7
|
orionis/_container/container_integrity.py,sha256=vrqZrkJaP6ghbiAzr-nEul9f_lEWVa2nMUSugQXDfWk,10095
|
@@ -222,11 +222,11 @@ orionis/foundation/config/session/enums/same_site_policy.py,sha256=Oo05CJ-5keJWz
|
|
222
222
|
orionis/foundation/config/session/helpers/secret_key.py,sha256=yafjzQ9KVQdXzCQCMthpgizlNCo5F5UTLtAnInipUMk,447
|
223
223
|
orionis/foundation/config/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
224
224
|
orionis/foundation/config/testing/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
225
|
-
orionis/foundation/config/testing/entities/testing.py,sha256=
|
225
|
+
orionis/foundation/config/testing/entities/testing.py,sha256=pIMb2DCwvu8K37ryiMXqOcS4VGDw0W8dJD-N37na8LM,10251
|
226
226
|
orionis/foundation/config/testing/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
227
227
|
orionis/foundation/config/testing/enums/test_mode.py,sha256=IbFpauu7J-iSAfmC8jDbmTEYl8eZr-AexL-lyOh8_74,337
|
228
228
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
229
|
-
orionis/metadata/framework.py,sha256=
|
229
|
+
orionis/metadata/framework.py,sha256=coJ-vdD_2l2ZfOFX6TgRpUlhDKlYAg8GimtIagyREhs,4960
|
230
230
|
orionis/metadata/package.py,sha256=5p4fxjPpaktsreJ458pAl-Oi1363MWACPQvqXi_N6oA,6704
|
231
231
|
orionis/patterns/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
232
232
|
orionis/patterns/singleton/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -235,8 +235,8 @@ orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
235
235
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
236
236
|
orionis/services/asynchrony/async_io.py,sha256=22rHi-sIHL3ESHpxKFps8O-9O_5Uoq-BbtZpMmgFTrA,1023
|
237
237
|
orionis/services/environment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
238
|
-
orionis/services/environment/dot_env.py,sha256=
|
239
|
-
orionis/services/environment/env.py,sha256=
|
238
|
+
orionis/services/environment/dot_env.py,sha256=PXU62gbOtzj-cZ4pt4dqYy17ywVVmomiSqUgXgcZm3M,9898
|
239
|
+
orionis/services/environment/env.py,sha256=SQo6PRGlsYHcXzm8WU5ownoS4F9JzPs-nNT0b7_w_Mo,2099
|
240
240
|
orionis/services/environment/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
241
241
|
orionis/services/environment/contracts/env.py,sha256=5g7jppzR5_ln8HlxJu2r0sSxLOkvBfSk3t4x_BKkYYk,1811
|
242
242
|
orionis/services/introspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -305,24 +305,30 @@ orionis/test/cases/test_async.py,sha256=YwycimGfUx9-kd_FFO8BZXyVayYwOBOzxbu3WZU_
|
|
305
305
|
orionis/test/cases/test_case.py,sha256=GVN3cxYuE47uPOEqFUiMreLdXjTyqzHjjxfyEM5_D4w,1446
|
306
306
|
orionis/test/cases/test_sync.py,sha256=FekXNQDq5pOQB2YpvP7E9jAqIJH9uZhTMoPz-qx8FO0,742
|
307
307
|
orionis/test/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
308
|
-
orionis/test/entities/test_result.py,sha256=
|
308
|
+
orionis/test/entities/test_result.py,sha256=4ZThMeYRus6Vabnn2MW4hFztIRJA0_W5R2rSJIw90Ho,2095
|
309
309
|
orionis/test/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
310
310
|
orionis/test/enums/test_mode.py,sha256=CHstYZ180MEX84AjZIoyA1l8gKxFLp_eciLOj2in57E,481
|
311
311
|
orionis/test/enums/test_status.py,sha256=vNKRmp1lud_ZGTayf3A8wO_0vEYdFABy_oMw-RcEc1c,673
|
312
312
|
orionis/test/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
313
313
|
orionis/test/exceptions/test_config_exception.py,sha256=yJv0JUTkZcF0Z4J8UHtffUipNgwNgmLhaqlOnnXFLyQ,995
|
314
314
|
orionis/test/exceptions/test_failure_exception.py,sha256=pcMhzF1Z5kkJm4yM7gZiQI0SvGjKFixJkRd6VBE03AY,2199
|
315
|
+
orionis/test/logs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
316
|
+
orionis/test/logs/history.py,sha256=8AqkCsGhd8S0PCBah2xFA0LN1YUnCmnwQvNmBmGmM2w,10097
|
317
|
+
orionis/test/logs/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
318
|
+
orionis/test/logs/contracts/history.py,sha256=6L-ELdCcn1kdTKD9XRGuqeP1TuLQiLrOSanOnoaLrKg,2088
|
315
319
|
orionis/test/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
316
320
|
orionis/test/output/dumper.py,sha256=pHD_HeokfWUydvaxxSvdJHdm2-VsrgL0PBr9ZSaavd8,3749
|
317
321
|
orionis/test/output/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
318
322
|
orionis/test/output/contracts/dumper.py,sha256=ZpzlSJixGNbjFUVl53mCg_5djC-xwiit4ozQlzUps4g,1161
|
319
323
|
orionis/test/suites/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
320
|
-
orionis/test/suites/test_suite.py,sha256=
|
321
|
-
orionis/test/suites/test_unit.py,sha256=
|
324
|
+
orionis/test/suites/test_suite.py,sha256=e8n9rDmym6Uj5D8E93ZUu_pQawKI-Gx5Fc1gaDlfN0o,5177
|
325
|
+
orionis/test/suites/test_unit.py,sha256=hWtGRubx0iV0dOZrirrvjfTTZQQ1FYwoyxEicweuHmg,44585
|
322
326
|
orionis/test/suites/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
323
327
|
orionis/test/suites/contracts/test_suite.py,sha256=arJSxWGjOHTVGiJrmqdqDrb9Ymt3SitDPZKVMBsWCf8,888
|
324
328
|
orionis/test/suites/contracts/test_unit.py,sha256=5gaGXqCx07aDlAQJi8J-GF83kVj3uIx_fdPF1HYMKcg,5596
|
325
|
-
orionis
|
329
|
+
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
330
|
+
orionis/test/view/index.html,sha256=U4XYO4hA-mAJCK1gcVRgIysmISK3g3Vgi2ntLofFAhE,6592
|
331
|
+
orionis-0.283.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
326
332
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
327
333
|
tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
328
334
|
tests/example/test_example.py,sha256=DUZU6lWVFsyHtBEXx0cBxMrSCpOtAOL3PUoi9-tXAas,583
|
@@ -386,7 +392,7 @@ tests/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
386
392
|
tests/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
387
393
|
tests/services/asynchrony/test_async_io.py,sha256=oS_PRgAluASK-7MEwEktRoPG6lSubWBPrtLMyhGOum4,1526
|
388
394
|
tests/services/environment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
389
|
-
tests/services/environment/test_env.py,sha256=
|
395
|
+
tests/services/environment/test_env.py,sha256=Fg4NejwmTdTTj4FezrWkJc639CzodGEgmdFa4EPlmqk,7084
|
390
396
|
tests/services/inspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
391
397
|
tests/services/inspection/dependencies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
392
398
|
tests/services/inspection/dependencies/test_reflect_dependencies.py,sha256=z0C9KkhV27Y7jKpLSCN9XCmHbjJDCPbBb7NkRFs3oMI,5803
|
@@ -420,8 +426,8 @@ tests/support/inspection/fakes/fake_reflection_instance_with_abstract.py,sha256=
|
|
420
426
|
tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
421
427
|
tests/testing/test_testing_result.py,sha256=54QDn6_v9feIcDcA6LPXcvYhlt_X8JqLGTYWS9XjKXM,3029
|
422
428
|
tests/testing/test_testing_unit.py,sha256=MeVL4gc4cGRPXdVOOKJx6JPKducrZ8cN7F52Iiciixg,5443
|
423
|
-
orionis-0.
|
424
|
-
orionis-0.
|
425
|
-
orionis-0.
|
426
|
-
orionis-0.
|
427
|
-
orionis-0.
|
429
|
+
orionis-0.283.0.dist-info/METADATA,sha256=7vHRB13iBUP3YekJnOOmvDd4coBejC3q-AHrsQzWr14,4772
|
430
|
+
orionis-0.283.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
431
|
+
orionis-0.283.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
432
|
+
orionis-0.283.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
433
|
+
orionis-0.283.0.dist-info/RECORD,,
|
@@ -14,7 +14,7 @@ class TestEnv(TestCase):
|
|
14
14
|
"""
|
15
15
|
with unittest_mock_patch.object(DotEnv, 'get', return_value='test_value') as mock_get:
|
16
16
|
result = Env.get('TEST_KEY')
|
17
|
-
mock_get.assert_called_once_with('TEST_KEY', None)
|
17
|
+
mock_get.assert_called_once_with('TEST_KEY', None, False)
|
18
18
|
self.assertEqual(result, 'test_value')
|
19
19
|
|
20
20
|
async def testGetMethodWithDefault(self):
|
@@ -24,7 +24,7 @@ class TestEnv(TestCase):
|
|
24
24
|
"""
|
25
25
|
with unittest_mock_patch.object(DotEnv, 'get', return_value='default_value') as mock_get:
|
26
26
|
result = Env.get('NON_EXISTENT_KEY', 'default_value')
|
27
|
-
mock_get.assert_called_once_with('NON_EXISTENT_KEY', 'default_value')
|
27
|
+
mock_get.assert_called_once_with('NON_EXISTENT_KEY', 'default_value', False)
|
28
28
|
self.assertEqual(result, 'default_value')
|
29
29
|
|
30
30
|
async def testSetMethod(self):
|
@@ -34,7 +34,7 @@ class TestEnv(TestCase):
|
|
34
34
|
"""
|
35
35
|
with unittest_mock_patch.object(DotEnv, 'set', return_value=True) as mock_set:
|
36
36
|
result = Env.set('TEST_KEY', 'test_value')
|
37
|
-
mock_set.assert_called_once_with('TEST_KEY', 'test_value')
|
37
|
+
mock_set.assert_called_once_with('TEST_KEY', 'test_value', False)
|
38
38
|
self.assertTrue(result)
|
39
39
|
|
40
40
|
async def testUnsetMethod(self):
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|