orionis 0.431.0__py3-none-any.whl → 0.432.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/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-0.431.0.dist-info → orionis-0.432.0.dist-info}/METADATA +1 -1
- {orionis-0.431.0.dist-info → orionis-0.432.0.dist-info}/RECORD +13 -13
- tests/metadata/test_metadata_framework.py +64 -90
- tests/metadata/test_metadata_package.py +31 -31
- {orionis-0.431.0.dist-info → orionis-0.432.0.dist-info}/WHEEL +0 -0
- {orionis-0.431.0.dist-info → orionis-0.432.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.431.0.dist-info → orionis-0.432.0.dist-info}/top_level.txt +0 -0
- {orionis-0.431.0.dist-info → orionis-0.432.0.dist-info}/zip-safe +0 -0
|
@@ -9,9 +9,9 @@ class VersionCommand(BaseCommand):
|
|
|
9
9
|
This command prints the version number of the framework in use.
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
signature = "version"
|
|
12
|
+
signature: str = "version"
|
|
13
13
|
|
|
14
|
-
description = "Prints the version of the framework in use."
|
|
14
|
+
description: str = "Prints the version of the framework in use."
|
|
15
15
|
|
|
16
16
|
def handle(self) -> None:
|
|
17
17
|
"""
|
orionis/console/core/reactor.py
CHANGED
|
@@ -7,10 +7,10 @@ from orionis.support.entities.base import BaseEntity
|
|
|
7
7
|
class Paths(BaseEntity):
|
|
8
8
|
|
|
9
9
|
console_scheduler: str = field(
|
|
10
|
-
default_factory = lambda: str((Path.cwd() / 'app' / 'console' / '
|
|
10
|
+
default_factory = lambda: str((Path.cwd() / 'app' / 'console' / 'scheduler.py').resolve()),
|
|
11
11
|
metadata = {
|
|
12
12
|
'description': 'Path to the console scheduler (Kernel) file.',
|
|
13
|
-
'default': lambda: str((Path.cwd() / 'app' / 'console' / '
|
|
13
|
+
'default': lambda: str((Path.cwd() / 'app' / 'console' / 'scheduler.py').resolve())
|
|
14
14
|
}
|
|
15
15
|
)
|
|
16
16
|
|
orionis/metadata/framework.py
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
NAME = "orionis"
|
|
6
6
|
|
|
7
7
|
# Current version of the framework
|
|
8
|
-
VERSION = "0.
|
|
8
|
+
VERSION = "0.432.0"
|
|
9
9
|
|
|
10
10
|
# Full name of the author or maintainer of the project
|
|
11
11
|
AUTHOR = "Raul Mauricio Uñate Castro"
|
|
@@ -42,38 +42,24 @@ PYTHON_REQUIRES = ">=3.12"
|
|
|
42
42
|
#---------------------------------------------------------------------------
|
|
43
43
|
# List of classifiers that provide metadata about the project for PyPI and other tools.
|
|
44
44
|
CLASSIFIERS = [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
'Development Status :: 3 - Alpha',
|
|
46
|
+
'Environment :: Web Environment',
|
|
47
|
+
'Intended Audience :: Developers',
|
|
48
|
+
'License :: OSI Approved :: MIT License',
|
|
49
|
+
'Operating System :: OS Independent',
|
|
50
|
+
'Programming Language :: Python',
|
|
51
|
+
'Programming Language :: Python :: 3',
|
|
52
|
+
'Programming Language :: Python :: 3 :: Only',
|
|
53
|
+
'Programming Language :: Python :: 3.12',
|
|
54
|
+
'Programming Language :: Python :: 3.13',
|
|
55
|
+
'Typing :: Typed',
|
|
56
|
+
'Topic :: Internet :: WWW/HTTP',
|
|
57
|
+
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
|
|
58
|
+
'Topic :: Internet :: WWW/HTTP :: WSGI',
|
|
59
|
+
'Topic :: Software Development :: Libraries :: Application Frameworks',
|
|
60
|
+
'Topic :: Software Development :: Libraries :: Python Modules'
|
|
61
61
|
]
|
|
62
62
|
|
|
63
|
-
def get_classifiers():
|
|
64
|
-
"""
|
|
65
|
-
Returns the list of classifiers as strings, formatted for use in setup.py or pyproject.toml.
|
|
66
|
-
|
|
67
|
-
Each classifier tuple is joined with ' :: ' as required by Python packaging standards.
|
|
68
|
-
|
|
69
|
-
Returns:
|
|
70
|
-
list of str: Classifier strings, e.g., 'Programming Language :: Python :: 3.12'
|
|
71
|
-
"""
|
|
72
|
-
return [
|
|
73
|
-
" :: ".join(classtuple)
|
|
74
|
-
for classtuple in CLASSIFIERS
|
|
75
|
-
]
|
|
76
|
-
|
|
77
63
|
#---------------------------------------------------------------------------
|
|
78
64
|
# Project Keywords
|
|
79
65
|
#---------------------------------------------------------------------------
|
|
@@ -92,46 +78,33 @@ KEYWORDS = [
|
|
|
92
78
|
#---------------------------------------------------------------------------
|
|
93
79
|
# List of required packages and their minimum versions.
|
|
94
80
|
REQUIRES = [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
81
|
+
'apscheduler>=3.11.0',
|
|
82
|
+
'python-dotenv>=1.0.1',
|
|
83
|
+
'requests>=2.32.3',
|
|
84
|
+
'rich>=13.9.4',
|
|
85
|
+
'psutil>=7.0.0',
|
|
86
|
+
'cryptography>=44.0.3'
|
|
101
87
|
]
|
|
102
88
|
|
|
103
|
-
|
|
89
|
+
#---------------------------------------------------------------------------
|
|
90
|
+
# Function to retrieve the icon SVG code
|
|
91
|
+
#---------------------------------------------------------------------------
|
|
92
|
+
# This function reads the 'icon.svg' file from the current directory and returns its content.
|
|
93
|
+
def icon():
|
|
104
94
|
"""
|
|
105
|
-
Returns the
|
|
95
|
+
Returns the SVG code for the project's icon image.
|
|
106
96
|
|
|
107
|
-
|
|
97
|
+
Reads the 'icon.svg' file from the current directory and returns its content.
|
|
108
98
|
|
|
109
99
|
Returns:
|
|
110
|
-
|
|
111
|
-
"""
|
|
112
|
-
return [
|
|
113
|
-
">=".join(requirement)
|
|
114
|
-
for requirement in REQUIRES
|
|
115
|
-
]
|
|
116
|
-
|
|
117
|
-
def get_svg_assets():
|
|
100
|
+
str: SVG code as a string, or None if the file is not found.
|
|
118
101
|
"""
|
|
119
|
-
|
|
102
|
+
import os
|
|
120
103
|
|
|
121
|
-
|
|
104
|
+
path = os.path.join(os.path.dirname(__file__), 'icon.svg')
|
|
122
105
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
icon_path = os.path.join(current_dir, "static", "svg", "logo.svg")
|
|
129
|
-
text_path = os.path.join(current_dir, "static", "svg", "text.svg")
|
|
130
|
-
with open(icon_path, 'r', encoding='utf-8') as icon_file:
|
|
131
|
-
icon_svg = icon_file.read()
|
|
132
|
-
with open(text_path, 'r', encoding='utf-8') as text_file:
|
|
133
|
-
text_svg = text_file.read()
|
|
134
|
-
return {
|
|
135
|
-
'icon': icon_svg,
|
|
136
|
-
'text': text_svg,
|
|
137
|
-
}
|
|
106
|
+
try:
|
|
107
|
+
with open(path, 'r', encoding='utf-8') as f:
|
|
108
|
+
return f.read()
|
|
109
|
+
except FileNotFoundError:
|
|
110
|
+
return None
|
orionis/metadata/package.py
CHANGED
|
@@ -1,158 +1,384 @@
|
|
|
1
1
|
import requests
|
|
2
2
|
from orionis.metadata.framework import API
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class PypiOrionisPackage:
|
|
5
5
|
"""
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
Provides an interface for retrieving and accessing metadata about the Orionis package from PyPI.
|
|
7
|
+
|
|
8
|
+
This class automatically fetches metadata from the PyPI JSON API for the Orionis package upon initialization.
|
|
9
|
+
The metadata includes information such as package name, version, author, description, license, classifiers,
|
|
10
|
+
required Python version, keywords, and project URLs. The metadata is stored internally and can be accessed
|
|
11
|
+
through dedicated methods.
|
|
12
|
+
|
|
13
|
+
Attributes
|
|
14
|
+
----------
|
|
15
|
+
_baseUrl : str
|
|
16
|
+
The base URL for the PyPI API endpoint used to fetch package metadata.
|
|
17
|
+
_info : dict
|
|
18
|
+
A dictionary containing the metadata retrieved from the PyPI API.
|
|
19
|
+
|
|
20
|
+
Notes
|
|
21
|
+
-----
|
|
22
|
+
The metadata is retrieved using the PyPI JSON API and stored in the `_info` attribute.
|
|
23
|
+
If the request fails or the response structure is invalid, an exception will be raised during initialization.
|
|
10
24
|
"""
|
|
11
25
|
|
|
12
26
|
def __init__(self) -> None:
|
|
13
27
|
"""
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
Initialize the PypiOrionisPackage instance.
|
|
29
|
+
|
|
30
|
+
This constructor sets up the base URL for the Orionis PyPI package, initializes the internal
|
|
31
|
+
information dictionary, and immediately fetches all available package metadata from PyPI.
|
|
32
|
+
|
|
33
|
+
Parameters
|
|
34
|
+
----------
|
|
35
|
+
None
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
None
|
|
40
|
+
This method does not return any value. It initializes instance attributes and populates
|
|
41
|
+
the `_info` dictionary with package metadata.
|
|
42
|
+
|
|
43
|
+
Notes
|
|
44
|
+
-----
|
|
45
|
+
The metadata is retrieved using the PyPI JSON API and stored in the `_info` attribute.
|
|
46
|
+
If the request fails, an exception will be raised during initialization.
|
|
16
47
|
"""
|
|
17
|
-
self._baseUrl = API
|
|
18
|
-
self._info = {}
|
|
19
|
-
self.getAllData()
|
|
48
|
+
self._baseUrl = API # Set the base URL for the PyPI API endpoint
|
|
49
|
+
self._info = {} # Initialize the dictionary to store package metadata
|
|
50
|
+
self.getAllData() # Fetch and populate metadata from PyPI
|
|
20
51
|
|
|
21
52
|
def getAllData(self) -> dict:
|
|
22
53
|
"""
|
|
23
|
-
|
|
54
|
+
Fetch and update package metadata from the PyPI API.
|
|
24
55
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
56
|
+
This method sends a GET request to the PyPI JSON API endpoint specified by `self._baseUrl`.
|
|
57
|
+
If the request is successful (HTTP status code 200), it parses the JSON response and updates
|
|
58
|
+
the internal `_info` attribute with the value associated with the "info" key. If the "info"
|
|
59
|
+
key is missing or the request fails, an exception is raised.
|
|
28
60
|
|
|
29
|
-
|
|
30
|
-
|
|
61
|
+
Parameters
|
|
62
|
+
----------
|
|
63
|
+
None
|
|
64
|
+
|
|
65
|
+
Returns
|
|
66
|
+
-------
|
|
67
|
+
dict
|
|
68
|
+
A dictionary containing the package metadata retrieved from PyPI. This dictionary is also
|
|
69
|
+
stored in the instance's `_info` attribute.
|
|
70
|
+
|
|
71
|
+
Raises
|
|
72
|
+
------
|
|
73
|
+
Exception
|
|
74
|
+
If the request to the PyPI API fails, returns a non-200 status code, or the response
|
|
75
|
+
structure is invalid (missing the "info" key).
|
|
76
|
+
|
|
77
|
+
Notes
|
|
78
|
+
-----
|
|
79
|
+
The method uses a timeout of 10 seconds for the HTTP request to avoid hanging indefinitely.
|
|
31
80
|
"""
|
|
32
81
|
try:
|
|
82
|
+
# Send a GET request to the PyPI API endpoint
|
|
33
83
|
response = requests.get(self._baseUrl, timeout=10)
|
|
84
|
+
|
|
85
|
+
# Raise an error for non-200 status codes
|
|
34
86
|
response.raise_for_status()
|
|
35
|
-
|
|
87
|
+
|
|
88
|
+
# Parse the JSON response
|
|
89
|
+
data: dict = response.json()
|
|
90
|
+
|
|
91
|
+
# Extract the 'info' section containing package metadata
|
|
36
92
|
self._info = data.get("info", {})
|
|
93
|
+
|
|
94
|
+
# Raise an error if 'info' key is missing or empty
|
|
37
95
|
if not self._info:
|
|
38
96
|
raise ValueError("No 'info' key found in PyPI response.")
|
|
97
|
+
|
|
98
|
+
# Return the package metadata dictionary
|
|
39
99
|
return self._info
|
|
100
|
+
|
|
40
101
|
except requests.RequestException as e:
|
|
102
|
+
|
|
103
|
+
# Handle network or HTTP errors
|
|
41
104
|
raise Exception(
|
|
42
105
|
f"Error fetching data from PyPI: {e}. "
|
|
43
106
|
"Please check your internet connection or try again later."
|
|
44
107
|
)
|
|
45
108
|
except ValueError as ve:
|
|
109
|
+
|
|
110
|
+
# Handle invalid response structure
|
|
46
111
|
raise Exception(
|
|
47
112
|
f"Invalid response structure from PyPI: {ve}"
|
|
48
113
|
)
|
|
49
114
|
|
|
50
115
|
def getName(self) -> str:
|
|
51
116
|
"""
|
|
52
|
-
|
|
117
|
+
Retrieve the package name from the internal metadata dictionary.
|
|
53
118
|
|
|
54
|
-
|
|
55
|
-
|
|
119
|
+
This method accesses the '_info' attribute, which contains metadata fetched from the PyPI API,
|
|
120
|
+
and returns the value associated with the 'name' key. The package name uniquely identifies the
|
|
121
|
+
Python package as registered on PyPI.
|
|
122
|
+
|
|
123
|
+
Returns
|
|
124
|
+
-------
|
|
125
|
+
str
|
|
126
|
+
The name of the package as specified in the PyPI metadata.
|
|
127
|
+
|
|
128
|
+
Notes
|
|
129
|
+
-----
|
|
130
|
+
The '_info' dictionary must be populated before calling this method, typically during initialization.
|
|
131
|
+
If the 'name' key is missing, a KeyError will be raised.
|
|
56
132
|
"""
|
|
133
|
+
|
|
134
|
+
# Return the package name from the metadata dictionary
|
|
57
135
|
return self._info['name']
|
|
58
136
|
|
|
59
137
|
def getVersion(self) -> str:
|
|
60
138
|
"""
|
|
61
|
-
|
|
139
|
+
Retrieve the version information of the Orionis framework from the internal metadata dictionary.
|
|
62
140
|
|
|
63
|
-
|
|
64
|
-
|
|
141
|
+
This method accesses the '_info' attribute, which contains metadata fetched from the PyPI API,
|
|
142
|
+
and returns the value associated with the 'version' key. The version string uniquely identifies
|
|
143
|
+
the current release of the package as registered on PyPI.
|
|
144
|
+
|
|
145
|
+
Returns
|
|
146
|
+
-------
|
|
147
|
+
str
|
|
148
|
+
The version string of the Orionis framework as specified in the PyPI metadata.
|
|
149
|
+
|
|
150
|
+
Notes
|
|
151
|
+
-----
|
|
152
|
+
The '_info' dictionary must be populated before calling this method, typically during initialization.
|
|
153
|
+
If the 'version' key is missing, a KeyError will be raised.
|
|
65
154
|
"""
|
|
155
|
+
|
|
156
|
+
# Return the version string from the metadata dictionary
|
|
66
157
|
return self._info['version']
|
|
67
158
|
|
|
68
159
|
def getAuthor(self) -> str:
|
|
69
160
|
"""
|
|
70
|
-
|
|
161
|
+
Retrieve the author's name from the internal metadata dictionary.
|
|
71
162
|
|
|
72
|
-
|
|
73
|
-
|
|
163
|
+
This method accesses the '_info' attribute, which contains metadata fetched from the PyPI API,
|
|
164
|
+
and returns the value associated with the 'author' key. The author's name identifies the individual
|
|
165
|
+
or organization responsible for maintaining the Orionis framework package.
|
|
166
|
+
|
|
167
|
+
Returns
|
|
168
|
+
-------
|
|
169
|
+
str
|
|
170
|
+
The author's name as specified in the PyPI metadata. If the 'author' key is missing, a KeyError will be raised.
|
|
171
|
+
|
|
172
|
+
Notes
|
|
173
|
+
-----
|
|
174
|
+
The '_info' dictionary must be populated before calling this method, typically during initialization.
|
|
74
175
|
"""
|
|
176
|
+
|
|
177
|
+
# Return the author's name from the metadata dictionary
|
|
75
178
|
return self._info['author']
|
|
76
179
|
|
|
77
180
|
def getAuthorEmail(self) -> str:
|
|
78
181
|
"""
|
|
79
|
-
Retrieve the author's email address from the internal
|
|
182
|
+
Retrieve the author's email address from the internal metadata dictionary.
|
|
80
183
|
|
|
81
|
-
|
|
82
|
-
|
|
184
|
+
This method accesses the '_info' attribute, which contains metadata fetched from the PyPI API,
|
|
185
|
+
and returns the value associated with the 'author_email' key. The author's email address is useful
|
|
186
|
+
for contacting the maintainer of the Orionis framework package.
|
|
187
|
+
|
|
188
|
+
Returns
|
|
189
|
+
-------
|
|
190
|
+
str
|
|
191
|
+
The email address of the author as specified in the PyPI metadata. If the 'author_email' key
|
|
192
|
+
is missing, a KeyError will be raised.
|
|
193
|
+
|
|
194
|
+
Notes
|
|
195
|
+
-----
|
|
196
|
+
The '_info' dictionary must be populated before calling this method, typically during initialization.
|
|
83
197
|
"""
|
|
198
|
+
|
|
199
|
+
# Return the author's email address from the metadata dictionary
|
|
84
200
|
return self._info['author_email']
|
|
85
201
|
|
|
86
202
|
def getDescription(self) -> str:
|
|
87
203
|
"""
|
|
88
|
-
|
|
204
|
+
Retrieve the summary description of the Orionis framework package.
|
|
205
|
+
|
|
206
|
+
This method accesses the internal `_info` dictionary, which contains metadata fetched from the PyPI API,
|
|
207
|
+
and returns the value associated with the 'summary' key. The summary provides a brief description of the
|
|
208
|
+
package as registered on PyPI.
|
|
89
209
|
|
|
90
|
-
Returns
|
|
91
|
-
|
|
210
|
+
Returns
|
|
211
|
+
-------
|
|
212
|
+
str
|
|
213
|
+
The summary description of the Orionis framework package, as stored in the '_info' dictionary under the 'summary' key.
|
|
214
|
+
|
|
215
|
+
Notes
|
|
216
|
+
-----
|
|
217
|
+
The '_info' dictionary must be populated before calling this method, typically during initialization.
|
|
218
|
+
If the 'summary' key is missing, a KeyError will be raised.
|
|
92
219
|
"""
|
|
220
|
+
|
|
221
|
+
# Return the summary description from the metadata dictionary
|
|
93
222
|
return self._info['summary']
|
|
94
223
|
|
|
95
224
|
def getUrl(self) -> str:
|
|
96
225
|
"""
|
|
97
|
-
|
|
226
|
+
Retrieve the homepage URL of the Orionis framework package from PyPI metadata.
|
|
227
|
+
|
|
228
|
+
This method accesses the internal `_info` dictionary, which contains metadata fetched from the PyPI API,
|
|
229
|
+
and extracts the homepage URL from the 'project_urls' sub-dictionary under the 'Homepage' key. The homepage
|
|
230
|
+
URL typically points to the main website or documentation for the Orionis framework.
|
|
98
231
|
|
|
99
|
-
Returns
|
|
100
|
-
|
|
232
|
+
Returns
|
|
233
|
+
-------
|
|
234
|
+
str
|
|
235
|
+
The homepage URL of the Orionis framework package as specified in the PyPI metadata under
|
|
236
|
+
`_info['project_urls']['Homepage']`.
|
|
237
|
+
|
|
238
|
+
Notes
|
|
239
|
+
-----
|
|
240
|
+
The `_info` dictionary must be populated before calling this method, typically during initialization.
|
|
241
|
+
If the 'Homepage' key is missing in the 'project_urls' dictionary, a KeyError will be raised.
|
|
101
242
|
"""
|
|
243
|
+
|
|
244
|
+
# Access the 'project_urls' dictionary and return the 'Homepage' URL
|
|
102
245
|
return self._info['project_urls']['Homepage']
|
|
103
246
|
|
|
104
247
|
def getLongDescription(self) -> str:
|
|
105
248
|
"""
|
|
106
|
-
|
|
249
|
+
Retrieve the long description of the Orionis framework package.
|
|
250
|
+
|
|
251
|
+
This method accesses the internal `_info` dictionary, which contains metadata fetched from the PyPI API,
|
|
252
|
+
and returns the value associated with the 'description' key. The long description typically provides
|
|
253
|
+
a detailed overview of the package, including features, usage, and other relevant information as
|
|
254
|
+
registered on PyPI.
|
|
107
255
|
|
|
108
|
-
Returns
|
|
109
|
-
|
|
256
|
+
Returns
|
|
257
|
+
-------
|
|
258
|
+
str
|
|
259
|
+
The long description text of the Orionis framework package, as stored in the '_info' dictionary
|
|
260
|
+
under the 'description' key.
|
|
261
|
+
|
|
262
|
+
Notes
|
|
263
|
+
-----
|
|
264
|
+
The '_info' dictionary must be populated before calling this method, typically during initialization.
|
|
265
|
+
If the 'description' key is missing, a KeyError will be raised.
|
|
110
266
|
"""
|
|
267
|
+
|
|
268
|
+
# Return the long description from the metadata dictionary
|
|
111
269
|
return self._info['description']
|
|
112
270
|
|
|
113
271
|
def getDescriptionContentType(self) -> str:
|
|
114
272
|
"""
|
|
115
|
-
|
|
273
|
+
Retrieve the content type of the package description from the internal metadata dictionary.
|
|
274
|
+
|
|
275
|
+
This method accesses the `_info` attribute, which contains metadata fetched from the PyPI API,
|
|
276
|
+
and returns the value associated with the 'description_content_type' key. The content type
|
|
277
|
+
indicates the format of the package's long description, such as 'text/markdown' or 'text/plain'.
|
|
116
278
|
|
|
117
|
-
Returns
|
|
118
|
-
|
|
279
|
+
Returns
|
|
280
|
+
-------
|
|
281
|
+
str
|
|
282
|
+
The content type of the package description (e.g., 'text/markdown', 'text/plain') as specified
|
|
283
|
+
in the PyPI metadata under the 'description_content_type' key.
|
|
284
|
+
|
|
285
|
+
Notes
|
|
286
|
+
-----
|
|
287
|
+
The `_info` dictionary must be populated before calling this method, typically during initialization.
|
|
288
|
+
If the 'description_content_type' key is missing, a KeyError will be raised.
|
|
119
289
|
"""
|
|
290
|
+
|
|
291
|
+
# Return the content type of the description from the metadata dictionary
|
|
120
292
|
return self._info['description_content_type']
|
|
121
293
|
|
|
122
294
|
def getLicense(self) -> str:
|
|
123
295
|
"""
|
|
124
|
-
|
|
296
|
+
Retrieve the license type specified in the framework metadata.
|
|
125
297
|
|
|
126
|
-
|
|
298
|
+
This method accesses the internal `_info` dictionary, which contains metadata fetched from the PyPI API,
|
|
299
|
+
and returns the value associated with the 'license' key. If the license information is not set or is an
|
|
300
|
+
empty string, the method defaults to returning "MIT".
|
|
127
301
|
|
|
128
|
-
Returns
|
|
129
|
-
|
|
302
|
+
Returns
|
|
303
|
+
-------
|
|
304
|
+
str
|
|
305
|
+
The license type as specified in the PyPI metadata under the 'license' key. If the license is not set,
|
|
306
|
+
returns "MIT".
|
|
307
|
+
|
|
308
|
+
Notes
|
|
309
|
+
-----
|
|
310
|
+
The `_info` dictionary must be populated before calling this method, typically during initialization.
|
|
311
|
+
If the 'license' key is missing, a KeyError will be raised.
|
|
130
312
|
"""
|
|
313
|
+
|
|
314
|
+
# Return the license type from the metadata dictionary, defaulting to "MIT" if not set
|
|
131
315
|
return self._info['license'] or "MIT"
|
|
132
316
|
|
|
133
317
|
def getClassifiers(self) -> list:
|
|
134
318
|
"""
|
|
135
|
-
|
|
319
|
+
Retrieve the list of classifiers associated with the Orionis framework package.
|
|
136
320
|
|
|
137
|
-
|
|
138
|
-
|
|
321
|
+
This method accesses the internal `_info` dictionary, which contains metadata fetched from the PyPI API,
|
|
322
|
+
and returns the value associated with the 'classifiers' key. Classifiers are standardized strings used
|
|
323
|
+
by PyPI to categorize the package (e.g., supported Python versions, intended audience, license, etc.).
|
|
324
|
+
|
|
325
|
+
Returns
|
|
326
|
+
-------
|
|
327
|
+
list of str
|
|
328
|
+
A list of classifier strings as specified in the PyPI metadata under the 'classifiers' key.
|
|
329
|
+
Each string describes a category or property of the package.
|
|
330
|
+
|
|
331
|
+
Notes
|
|
332
|
+
-----
|
|
333
|
+
The `_info` dictionary must be populated before calling this method, typically during initialization.
|
|
334
|
+
If the 'classifiers' key is missing, a KeyError will be raised.
|
|
139
335
|
"""
|
|
336
|
+
|
|
337
|
+
# Return the list of classifiers from the metadata dictionary
|
|
140
338
|
return self._info['classifiers']
|
|
141
339
|
|
|
142
340
|
def getPythonVersion(self) -> str:
|
|
143
341
|
"""
|
|
144
|
-
|
|
342
|
+
Retrieve the required Python version specification from the package metadata.
|
|
145
343
|
|
|
146
|
-
|
|
147
|
-
|
|
344
|
+
This method accesses the internal `_info` dictionary, which contains metadata fetched from the PyPI API,
|
|
345
|
+
and returns the value associated with the 'requires_python' key. The returned string specifies the Python
|
|
346
|
+
version(s) required to use the Orionis framework package, as defined in its PyPI metadata.
|
|
347
|
+
|
|
348
|
+
Returns
|
|
349
|
+
-------
|
|
350
|
+
str
|
|
351
|
+
The Python version specification required by the framework, as defined in the '_info' dictionary
|
|
352
|
+
under the 'requires_python' key. For example, it may return a string like '>=3.7'.
|
|
353
|
+
|
|
354
|
+
Notes
|
|
355
|
+
-----
|
|
356
|
+
The `_info` dictionary must be populated before calling this method, typically during initialization.
|
|
357
|
+
If the 'requires_python' key is missing, a KeyError will be raised.
|
|
148
358
|
"""
|
|
359
|
+
|
|
360
|
+
# Return the required Python version specification from the metadata dictionary
|
|
149
361
|
return self._info['requires_python']
|
|
150
362
|
|
|
151
363
|
def getKeywords(self) -> list:
|
|
152
364
|
"""
|
|
153
|
-
Retrieve the list of keywords associated with the
|
|
365
|
+
Retrieve the list of keywords associated with the Orionis framework package.
|
|
154
366
|
|
|
155
|
-
|
|
156
|
-
|
|
367
|
+
This method accesses the internal `_info` dictionary, which contains metadata fetched from the PyPI API,
|
|
368
|
+
and returns the value associated with the 'keywords' key. Keywords are typically used to describe the
|
|
369
|
+
package's functionality, domain, or relevant search terms on PyPI.
|
|
370
|
+
|
|
371
|
+
Returns
|
|
372
|
+
-------
|
|
373
|
+
list of str
|
|
374
|
+
A list of keywords describing the Orionis framework package, as specified in the PyPI metadata
|
|
375
|
+
under the 'keywords' key.
|
|
376
|
+
|
|
377
|
+
Notes
|
|
378
|
+
-----
|
|
379
|
+
The `_info` dictionary must be populated before calling this method, typically during initialization.
|
|
380
|
+
If the 'keywords' key is missing, a KeyError will be raised.
|
|
157
381
|
"""
|
|
382
|
+
|
|
383
|
+
# Return the list of keywords from the metadata dictionary
|
|
158
384
|
return self._info['keywords']
|
|
@@ -5,9 +5,9 @@ orionis/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
|
5
5
|
orionis/console/base/command.py,sha256=2kKyTaEzI16Up-XCUeNeJmDWPLN-CweQm3EgrN9U8NQ,3027
|
|
6
6
|
orionis/console/base/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
orionis/console/base/contracts/command.py,sha256=s9yjma-s1URkVm0EbVvSkETAm-N8xX7OnZS43P8pvk8,1957
|
|
8
|
-
orionis/console/commands/version.py,sha256=
|
|
8
|
+
orionis/console/commands/version.py,sha256=TfiuMCcESdlNuhnbl_h9qbOb8aYDXcc5X1J5LfD1v7M,1041
|
|
9
9
|
orionis/console/contracts/kernel.py,sha256=fzD8FNVSKEQ5gW5D83hVecz9dVHgy28rRDORDdghp4s,409
|
|
10
|
-
orionis/console/core/reactor.py,sha256=
|
|
10
|
+
orionis/console/core/reactor.py,sha256=lNfj-L4MKZhBn07l4H5L5dVW2xBRiq6-kyIuqnUNawQ,73
|
|
11
11
|
orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
orionis/console/dumper/dump.py,sha256=CATERiQ6XuIrKQsDaWcVxzTtlAJI9qLJX44fQxEX8ws,22443
|
|
13
13
|
orionis/console/dumper/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -140,7 +140,7 @@ orionis/foundation/config/queue/entities/queue.py,sha256=YiWPeEg5e0fd_DJM2ogska6
|
|
|
140
140
|
orionis/foundation/config/queue/enums/__init__.py,sha256=oWY8GWwr5mex7szs_bLVqAS1jbyuIAvKl7XFGSlU9A0,64
|
|
141
141
|
orionis/foundation/config/queue/enums/strategy.py,sha256=S_kw7KZtoCk5FTOkbuXepdy_fOl9Eav4uT2K0OyzBa0,602
|
|
142
142
|
orionis/foundation/config/roots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
143
|
-
orionis/foundation/config/roots/paths.py,sha256=
|
|
143
|
+
orionis/foundation/config/roots/paths.py,sha256=YosRpL9R6sSaEkW2PnymTCXSxPQb3-miWoUAC0pVYvw,10676
|
|
144
144
|
orionis/foundation/config/session/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
145
145
|
orionis/foundation/config/session/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
146
146
|
orionis/foundation/config/session/entities/session.py,sha256=sJoD-_CiwUR88tva-rO22bagG3RTcHXrQGWbq4B5joM,5998
|
|
@@ -172,8 +172,8 @@ orionis/foundation/providers/progress_bar_provider.py,sha256=WW3grNgH-yV2meSSTeO
|
|
|
172
172
|
orionis/foundation/providers/testing_provider.py,sha256=iJSN2RIChbYIL-1ue6vmPmDMCSrvERDkti4Er9MPiLA,1102
|
|
173
173
|
orionis/foundation/providers/workers_provider.py,sha256=kiQjQRyUEyiBX2zcbF_KmqRgvc7Bvxsvg5oMtIvYniM,1075
|
|
174
174
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
175
|
-
orionis/metadata/framework.py,sha256=
|
|
176
|
-
orionis/metadata/package.py,sha256=
|
|
175
|
+
orionis/metadata/framework.py,sha256=LBzTF3hSKCydEkAyPmHP7iDOK7OLk0C-XU4u8cpSnvU,4088
|
|
176
|
+
orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
|
|
177
177
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
178
178
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
179
179
|
orionis/services/asynchrony/coroutines.py,sha256=Aj5a1LTosnGUA0meSHivC1OJBYOQ7xq3US_PzWTc91w,3113
|
|
@@ -340,7 +340,7 @@ orionis/test/validators/web_report.py,sha256=-h3Fe9jY93_kzUhd2NBIqEfCcBpu-8Ei9x3
|
|
|
340
340
|
orionis/test/validators/workers.py,sha256=LGffDKtK6SKixFKzIYPQpI5aFeQPAGXpv_LUtmEu6g4,1102
|
|
341
341
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
342
342
|
orionis/test/view/render.py,sha256=3ICz68l-WF3BtnYqH5m-ktN9UD00MELMbmMnyJDV74A,4768
|
|
343
|
-
orionis-0.
|
|
343
|
+
orionis-0.432.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
|
344
344
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
345
345
|
tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
346
346
|
tests/container/test_container.py,sha256=asv8TkkupVoex6SWod74NBl4dSs7wb9mLmu_glNdNy8,14815
|
|
@@ -426,8 +426,8 @@ tests/foundation/config/startup/test_foundation_config_startup.py,sha256=9ZFwbWx
|
|
|
426
426
|
tests/foundation/config/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
427
427
|
tests/foundation/config/testing/test_foundation_config_testing.py,sha256=YsXTVxq-S1KVlLK5fe2qL0CpQrulaLmy6sMSm3oPhbA,8237
|
|
428
428
|
tests/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
429
|
-
tests/metadata/test_metadata_framework.py,sha256=
|
|
430
|
-
tests/metadata/test_metadata_package.py,sha256=
|
|
429
|
+
tests/metadata/test_metadata_framework.py,sha256=vOsp5owDMMoL5dtgiN9EC5Sdj8pemXVh62MzYpPUK4Q,5327
|
|
430
|
+
tests/metadata/test_metadata_package.py,sha256=AcD5rlkD5MeX2tJvQkIHeGeAl88k0tsF2wOU5v4JVN0,4894
|
|
431
431
|
tests/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
432
432
|
tests/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
433
433
|
tests/services/asynchrony/test_services_asynchrony_coroutine.py,sha256=34Y0D6w2bVo_dm3oj0wzedMIJuSYieUG9Y2J1EQmZeo,3439
|
|
@@ -485,8 +485,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
485
485
|
tests/testing/validators/test_testing_validators.py,sha256=QdcF0Vhnnl_kD-PzceHJbUYOqwPTB1Td7YaTv8LTr30,19612
|
|
486
486
|
tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
487
487
|
tests/testing/view/test_render.py,sha256=-ghGG8rimyb2b2wtvMuSPPH7Zac5_NlVCiUcHRA5SNg,1172
|
|
488
|
-
orionis-0.
|
|
489
|
-
orionis-0.
|
|
490
|
-
orionis-0.
|
|
491
|
-
orionis-0.
|
|
492
|
-
orionis-0.
|
|
488
|
+
orionis-0.432.0.dist-info/METADATA,sha256=UefeivB8kYskWoBDWmFfmDaWFDLVsR8fSGrbmjDtpUc,4772
|
|
489
|
+
orionis-0.432.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
490
|
+
orionis-0.432.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
|
491
|
+
orionis-0.432.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
492
|
+
orionis-0.432.0.dist-info/RECORD,,
|
|
@@ -4,163 +4,137 @@ from orionis.test.cases.asynchronous import AsyncTestCase
|
|
|
4
4
|
class TestMetadataFramework(AsyncTestCase):
|
|
5
5
|
"""
|
|
6
6
|
Test cases for the metadata constants and utility functions in orionis.metadata.framework.
|
|
7
|
-
|
|
8
|
-
Notes
|
|
9
|
-
-----
|
|
10
|
-
This test suite validates the existence, type, and structure of metadata constants and utility
|
|
11
|
-
functions provided by the `orionis.metadata.framework` module.
|
|
12
7
|
"""
|
|
13
8
|
|
|
14
9
|
async def testConstantsExistAndAreStr(self):
|
|
15
10
|
"""
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
This test iterates over a predefined list of metadata constants and checks
|
|
19
|
-
that each constant is present and its type is `str`.
|
|
11
|
+
Test that all required metadata constants exist and are of type `str`.
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
If any constant is not a string.
|
|
13
|
+
This method iterates over a predefined list of metadata constants and checks
|
|
14
|
+
that each is an instance of `str`. This ensures that the metadata values
|
|
15
|
+
required by the framework are properly defined and typed.
|
|
25
16
|
|
|
26
17
|
Returns
|
|
27
18
|
-------
|
|
28
19
|
None
|
|
29
|
-
This method does not return any value.
|
|
20
|
+
This is a test method and does not return any value. Assertions are used
|
|
21
|
+
to validate the conditions.
|
|
30
22
|
"""
|
|
31
23
|
|
|
32
|
-
#
|
|
24
|
+
# List of metadata constants to check
|
|
33
25
|
for const in [
|
|
34
26
|
NAME, VERSION, AUTHOR, AUTHOR_EMAIL, DESCRIPTION,
|
|
35
27
|
SKELETON, FRAMEWORK, DOCS, API, PYTHON_REQUIRES
|
|
36
28
|
]:
|
|
29
|
+
# Assert that each constant is a string
|
|
37
30
|
self.assertIsInstance(const, str)
|
|
38
31
|
|
|
39
32
|
async def testClassifiersStructure(self):
|
|
40
33
|
"""
|
|
41
|
-
|
|
34
|
+
Validate the structure and type of the `CLASSIFIERS` metadata constant.
|
|
42
35
|
|
|
43
|
-
This test
|
|
44
|
-
|
|
36
|
+
This test ensures that the `CLASSIFIERS` constant is a list of strings,
|
|
37
|
+
and that each string contains at least one '::' separator, which is
|
|
38
|
+
typical for Python package classifiers.
|
|
45
39
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
Parameters
|
|
41
|
+
----------
|
|
42
|
+
self : TestMetadataFramework
|
|
43
|
+
The test case instance.
|
|
50
44
|
|
|
51
45
|
Returns
|
|
52
46
|
-------
|
|
53
47
|
None
|
|
54
|
-
This method does not return any value.
|
|
48
|
+
This method does not return any value. Assertions are used to
|
|
49
|
+
validate the structure and contents of `CLASSIFIERS`.
|
|
55
50
|
"""
|
|
56
51
|
|
|
57
|
-
#
|
|
52
|
+
# Assert that CLASSIFIERS is a list
|
|
58
53
|
self.assertIsInstance(CLASSIFIERS, list)
|
|
59
|
-
|
|
60
|
-
# Check each item in CLASSIFIERS for tuple of strings
|
|
61
54
|
for item in CLASSIFIERS:
|
|
62
|
-
self.assertIsInstance(item, tuple)
|
|
63
|
-
self.assertTrue(all(isinstance(part, str) for part in item))
|
|
64
|
-
|
|
65
|
-
async def testGetClassifiers(self):
|
|
66
|
-
"""
|
|
67
|
-
Verify that `get_classifiers` returns a list of classifier strings.
|
|
68
|
-
|
|
69
|
-
This test calls the `get_classifiers` utility function and checks that
|
|
70
|
-
the returned value is a list of strings, each representing a classifier.
|
|
71
|
-
|
|
72
|
-
Raises
|
|
73
|
-
------
|
|
74
|
-
AssertionError
|
|
75
|
-
If the returned value is not a list of strings containing '::'.
|
|
76
55
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
None
|
|
80
|
-
This method does not return any value.
|
|
81
|
-
"""
|
|
56
|
+
# Assert that each item in CLASSIFIERS is a string
|
|
57
|
+
self.assertIsInstance(item, str)
|
|
82
58
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
self.assertIsInstance(classifiers, list)
|
|
86
|
-
for c in classifiers:
|
|
87
|
-
self.assertIsInstance(c, str)
|
|
88
|
-
self.assertTrue(" :: " in c or len(c.split(" :: ")) > 1)
|
|
59
|
+
# Assert that each classifier string contains at least one '::' separator
|
|
60
|
+
self.assertTrue("::" in item or len(item.split("::")) > 1)
|
|
89
61
|
|
|
90
62
|
async def testKeywords(self):
|
|
91
63
|
"""
|
|
92
|
-
|
|
64
|
+
Validate the structure and contents of the `KEYWORDS` metadata constant.
|
|
93
65
|
|
|
94
|
-
This test
|
|
95
|
-
|
|
66
|
+
This test checks that the `KEYWORDS` constant is a list of strings, ensuring
|
|
67
|
+
that each keyword is properly typed. Additionally, it verifies that the list
|
|
68
|
+
contains the essential keywords "orionis" and "framework", which are required
|
|
69
|
+
for accurate metadata representation.
|
|
96
70
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
71
|
+
Parameters
|
|
72
|
+
----------
|
|
73
|
+
self : TestMetadataFramework
|
|
74
|
+
The test case instance.
|
|
101
75
|
|
|
102
76
|
Returns
|
|
103
77
|
-------
|
|
104
78
|
None
|
|
105
|
-
This method does not return any value.
|
|
79
|
+
This method does not return any value. Assertions are used to validate
|
|
80
|
+
the structure and contents of `KEYWORDS`.
|
|
106
81
|
"""
|
|
107
82
|
|
|
108
|
-
#
|
|
83
|
+
# Assert that KEYWORDS is a list
|
|
109
84
|
self.assertIsInstance(KEYWORDS, list)
|
|
85
|
+
|
|
86
|
+
# Check that each keyword in KEYWORDS is a string
|
|
110
87
|
for kw in KEYWORDS:
|
|
111
88
|
self.assertIsInstance(kw, str)
|
|
112
89
|
|
|
113
|
-
#
|
|
90
|
+
# Ensure essential keywords are present in the list
|
|
114
91
|
self.assertIn("orionis", KEYWORDS)
|
|
115
92
|
self.assertIn("framework", KEYWORDS)
|
|
116
93
|
|
|
117
94
|
async def testRequiresStructure(self):
|
|
118
95
|
"""
|
|
119
|
-
Validate
|
|
96
|
+
Validate the structure and contents of the `REQUIRES` metadata constant.
|
|
120
97
|
|
|
121
|
-
This test checks
|
|
122
|
-
a
|
|
98
|
+
This test checks that the `REQUIRES` constant is a list of strings, where each string
|
|
99
|
+
represents a package requirement and contains the '>=' version specifier. This ensures
|
|
100
|
+
that all requirements are properly typed and formatted for dependency management.
|
|
123
101
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
102
|
+
Parameters
|
|
103
|
+
----------
|
|
104
|
+
self : TestMetadataFramework
|
|
105
|
+
The test case instance.
|
|
128
106
|
|
|
129
107
|
Returns
|
|
130
108
|
-------
|
|
131
109
|
None
|
|
132
|
-
This method does not return any value.
|
|
110
|
+
This method does not return any value. Assertions are used to validate
|
|
111
|
+
the structure and contents of `REQUIRES`.
|
|
133
112
|
"""
|
|
134
113
|
|
|
135
|
-
#
|
|
114
|
+
# Assert that REQUIRES is a list
|
|
136
115
|
self.assertIsInstance(REQUIRES, list)
|
|
116
|
+
|
|
117
|
+
# Check that each requirement in REQUIRES is a string and contains '>='
|
|
137
118
|
for req in REQUIRES:
|
|
138
|
-
self.assertIsInstance(req,
|
|
139
|
-
self.
|
|
140
|
-
self.assertTrue(all(isinstance(part, str) for part in req))
|
|
119
|
+
self.assertIsInstance(req, str) # Each requirement should be a string
|
|
120
|
+
self.assertIn(">=", req) # Each requirement should specify a minimum version
|
|
141
121
|
|
|
142
|
-
async def
|
|
122
|
+
async def testIconFunction(self):
|
|
143
123
|
"""
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
This test calls the `get_requires` utility function and checks that the
|
|
147
|
-
returned value is a list of strings, each representing a requirement and
|
|
148
|
-
containing the '>=' version specifier.
|
|
124
|
+
Test the behavior and return type of the `icon()` utility function.
|
|
149
125
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
If the returned value is not a list of strings containing '>='.
|
|
126
|
+
This test verifies that the `icon()` function returns either a string containing
|
|
127
|
+
SVG data or `None` if the icon file is not found. It ensures that the function's
|
|
128
|
+
output is correctly typed and handles missing resources gracefully.
|
|
154
129
|
|
|
155
130
|
Returns
|
|
156
131
|
-------
|
|
157
132
|
None
|
|
158
|
-
This method does not return any value.
|
|
133
|
+
This method does not return any value. Assertions are used to validate
|
|
134
|
+
the type and behavior of the `icon()` function.
|
|
159
135
|
"""
|
|
136
|
+
# Call the icon() function and store the result
|
|
137
|
+
result = icon()
|
|
160
138
|
|
|
161
|
-
#
|
|
162
|
-
|
|
163
|
-
self.assertIsInstance(requires, list)
|
|
164
|
-
for req in requires:
|
|
165
|
-
self.assertIsInstance(req, str)
|
|
166
|
-
self.assertIn(">=", req)
|
|
139
|
+
# Assert that the result is either a string (SVG data) or None (file not found)
|
|
140
|
+
self.assertTrue(isinstance(result, str) or result is None)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
2
2
|
from unittest.mock import patch
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class TestPypiOrionisPackage(AsyncTestCase):
|
|
5
5
|
|
|
6
|
-
@patch("orionis.metadata.package.
|
|
7
|
-
async def testGetName(self,
|
|
6
|
+
@patch("orionis.metadata.package.PypiOrionisPackage")
|
|
7
|
+
async def testGetName(self, MockPypiOrionisPackage):
|
|
8
8
|
"""
|
|
9
|
-
Tests the `getName` method of the `
|
|
9
|
+
Tests the `getName` method of the `PypiOrionisPackage` class.
|
|
10
10
|
|
|
11
11
|
This test verifies that the mocked `getName` method returns the expected package name.
|
|
12
12
|
|
|
13
13
|
Parameters
|
|
14
14
|
----------
|
|
15
|
-
|
|
16
|
-
Mocked `
|
|
15
|
+
MockPypiOrionisPackage : MagicMock
|
|
16
|
+
Mocked `PypiOrionisPackage` class.
|
|
17
17
|
|
|
18
18
|
Returns
|
|
19
19
|
-------
|
|
@@ -22,7 +22,7 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
24
|
# Get the mocked API instance
|
|
25
|
-
api =
|
|
25
|
+
api = MockPypiOrionisPackage.return_value
|
|
26
26
|
|
|
27
27
|
# Set the return value for getName
|
|
28
28
|
api.getName.return_value = "orionis"
|
|
@@ -30,17 +30,17 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
30
30
|
# Assert that getName returns the expected value
|
|
31
31
|
self.assertEqual(api.getName(), "orionis")
|
|
32
32
|
|
|
33
|
-
@patch("orionis.metadata.package.
|
|
34
|
-
async def testGetAuthor(self,
|
|
33
|
+
@patch("orionis.metadata.package.PypiOrionisPackage")
|
|
34
|
+
async def testGetAuthor(self, MockPypiOrionisPackage):
|
|
35
35
|
"""
|
|
36
|
-
Tests the `getAuthor` method of the `
|
|
36
|
+
Tests the `getAuthor` method of the `PypiOrionisPackage` class.
|
|
37
37
|
|
|
38
38
|
This test checks that the mocked `getAuthor` method returns the correct author name.
|
|
39
39
|
|
|
40
40
|
Parameters
|
|
41
41
|
----------
|
|
42
|
-
|
|
43
|
-
Mocked `
|
|
42
|
+
MockPypiOrionisPackage : MagicMock
|
|
43
|
+
Mocked `PypiOrionisPackage` class.
|
|
44
44
|
|
|
45
45
|
Returns
|
|
46
46
|
-------
|
|
@@ -49,7 +49,7 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
51
|
# Get the mocked API instance
|
|
52
|
-
api =
|
|
52
|
+
api = MockPypiOrionisPackage.return_value
|
|
53
53
|
|
|
54
54
|
# Set the return value for getAuthor
|
|
55
55
|
api.getAuthor.return_value = "Raul Mauricio Uñate Castro"
|
|
@@ -57,17 +57,17 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
57
57
|
# Assert that getAuthor returns the expected value
|
|
58
58
|
self.assertEqual(api.getAuthor(), "Raul Mauricio Uñate Castro")
|
|
59
59
|
|
|
60
|
-
@patch("orionis.metadata.package.
|
|
61
|
-
async def testGetAuthorEmail(self,
|
|
60
|
+
@patch("orionis.metadata.package.PypiOrionisPackage")
|
|
61
|
+
async def testGetAuthorEmail(self, MockPypiOrionisPackage):
|
|
62
62
|
"""
|
|
63
|
-
Tests the `getAuthorEmail` method of the `
|
|
63
|
+
Tests the `getAuthorEmail` method of the `PypiOrionisPackage` class.
|
|
64
64
|
|
|
65
65
|
This test ensures that the mocked `getAuthorEmail` method returns the correct author email address.
|
|
66
66
|
|
|
67
67
|
Parameters
|
|
68
68
|
----------
|
|
69
|
-
|
|
70
|
-
Mocked `
|
|
69
|
+
MockPypiOrionisPackage : MagicMock
|
|
70
|
+
Mocked `PypiOrionisPackage` class.
|
|
71
71
|
|
|
72
72
|
Returns
|
|
73
73
|
-------
|
|
@@ -76,7 +76,7 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
76
76
|
"""
|
|
77
77
|
|
|
78
78
|
# Get the mocked API instance
|
|
79
|
-
api =
|
|
79
|
+
api = MockPypiOrionisPackage.return_value
|
|
80
80
|
|
|
81
81
|
# Set the return value for getAuthorEmail
|
|
82
82
|
api.getAuthorEmail.return_value = "raulmauriciounate@gmail.com"
|
|
@@ -84,17 +84,17 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
84
84
|
# Assert that getAuthorEmail returns the expected value
|
|
85
85
|
self.assertEqual(api.getAuthorEmail(), "raulmauriciounate@gmail.com")
|
|
86
86
|
|
|
87
|
-
@patch("orionis.metadata.package.
|
|
88
|
-
async def testGetDescription(self,
|
|
87
|
+
@patch("orionis.metadata.package.PypiOrionisPackage")
|
|
88
|
+
async def testGetDescription(self, MockPypiOrionisPackage):
|
|
89
89
|
"""
|
|
90
|
-
Tests the `getDescription` method of the `
|
|
90
|
+
Tests the `getDescription` method of the `PypiOrionisPackage` class.
|
|
91
91
|
|
|
92
92
|
This test verifies that the mocked `getDescription` method returns the expected package description.
|
|
93
93
|
|
|
94
94
|
Parameters
|
|
95
95
|
----------
|
|
96
|
-
|
|
97
|
-
Mocked `
|
|
96
|
+
MockPypiOrionisPackage : MagicMock
|
|
97
|
+
Mocked `PypiOrionisPackage` class.
|
|
98
98
|
|
|
99
99
|
Returns
|
|
100
100
|
-------
|
|
@@ -103,7 +103,7 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
103
103
|
"""
|
|
104
104
|
|
|
105
105
|
# Get the mocked API instance
|
|
106
|
-
api =
|
|
106
|
+
api = MockPypiOrionisPackage.return_value
|
|
107
107
|
|
|
108
108
|
# Set the return value for getDescription
|
|
109
109
|
api.getDescription.return_value = "Orionis Framework – Elegant, Fast, and Powerful."
|
|
@@ -111,17 +111,17 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
111
111
|
# Assert that getDescription returns the expected value
|
|
112
112
|
self.assertEqual(api.getDescription(), "Orionis Framework – Elegant, Fast, and Powerful.")
|
|
113
113
|
|
|
114
|
-
@patch("orionis.metadata.package.
|
|
115
|
-
async def testGetPythonVersion(self,
|
|
114
|
+
@patch("orionis.metadata.package.PypiOrionisPackage")
|
|
115
|
+
async def testGetPythonVersion(self, MockPypiOrionisPackage):
|
|
116
116
|
"""
|
|
117
|
-
Tests the `getPythonVersion` method of the `
|
|
117
|
+
Tests the `getPythonVersion` method of the `PypiOrionisPackage` class.
|
|
118
118
|
|
|
119
119
|
This test checks that the mocked `getPythonVersion` method returns the correct Python version requirement.
|
|
120
120
|
|
|
121
121
|
Parameters
|
|
122
122
|
----------
|
|
123
|
-
|
|
124
|
-
Mocked `
|
|
123
|
+
MockPypiOrionisPackage : MagicMock
|
|
124
|
+
Mocked `PypiOrionisPackage` class.
|
|
125
125
|
|
|
126
126
|
Returns
|
|
127
127
|
-------
|
|
@@ -130,7 +130,7 @@ class TestPypiPackageApi(AsyncTestCase):
|
|
|
130
130
|
"""
|
|
131
131
|
|
|
132
132
|
# Get the mocked API instance
|
|
133
|
-
api =
|
|
133
|
+
api = MockPypiOrionisPackage.return_value
|
|
134
134
|
|
|
135
135
|
# Set the return value for getPythonVersion
|
|
136
136
|
api.getPythonVersion.return_value = ">=3.12"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|