pyquoks 2.0.1__tar.gz → 2.0.3__tar.gz
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.
- {pyquoks-2.0.1 → pyquoks-2.0.3}/PKG-INFO +1 -1
- {pyquoks-2.0.1 → pyquoks-2.0.3}/pyproject.toml +1 -1
- {pyquoks-2.0.1 → pyquoks-2.0.3}/src/pyquoks/data.py +3 -2
- {pyquoks-2.0.1 → pyquoks-2.0.3}/src/pyquoks/test.py +30 -1
- {pyquoks-2.0.1 → pyquoks-2.0.3}/src/pyquoks/utils.py +4 -3
- {pyquoks-2.0.1 → pyquoks-2.0.3}/LICENSE +0 -0
- {pyquoks-2.0.1 → pyquoks-2.0.3}/README.md +0 -0
- {pyquoks-2.0.1 → pyquoks-2.0.3}/src/pyquoks/__init__.py +0 -0
- {pyquoks-2.0.1 → pyquoks-2.0.3}/src/pyquoks/localhost.py +0 -0
- {pyquoks-2.0.1 → pyquoks-2.0.3}/src/pyquoks/models.py +0 -0
|
@@ -213,7 +213,8 @@ class StringsProvider(pyquoks.utils._HasRequiredAttributes):
|
|
|
213
213
|
"""
|
|
214
214
|
|
|
215
215
|
# noinspection PyUnusedLocal
|
|
216
|
-
def __init__(self, parent: StringsProvider) -> None:
|
|
216
|
+
def __init__(self, parent: StringsProvider) -> None:
|
|
217
|
+
... # TODO
|
|
217
218
|
|
|
218
219
|
_REQUIRED_ATTRIBUTES = {
|
|
219
220
|
"_OBJECTS",
|
|
@@ -459,7 +460,7 @@ class DatabaseManager(pyquoks.utils._HasRequiredAttributes):
|
|
|
459
460
|
|
|
460
461
|
_PATH: str = pyquoks.utils.get_path("db/")
|
|
461
462
|
|
|
462
|
-
def __init__(self):
|
|
463
|
+
def __init__(self) -> None:
|
|
463
464
|
self._check_attributes()
|
|
464
465
|
|
|
465
466
|
os.makedirs(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
import unittest, types
|
|
2
|
+
import unittest, typing, types
|
|
3
3
|
import pyquoks.data, pyquoks.utils
|
|
4
4
|
|
|
5
5
|
|
|
@@ -60,6 +60,35 @@ class TestCase(unittest.TestCase, pyquoks.utils._HasRequiredAttributes):
|
|
|
60
60
|
raise_again=True,
|
|
61
61
|
)
|
|
62
62
|
|
|
63
|
+
def assert_raises(
|
|
64
|
+
self,
|
|
65
|
+
func_name: str,
|
|
66
|
+
test_func: typing.Callable,
|
|
67
|
+
test_exception: type[BaseException],
|
|
68
|
+
*args,
|
|
69
|
+
**kwargs,
|
|
70
|
+
) -> None:
|
|
71
|
+
self._logger.info(
|
|
72
|
+
msg=(
|
|
73
|
+
f"{self._get_func_name(func_name)}:\n"
|
|
74
|
+
f"Function: {test_func.__name__}()\n"
|
|
75
|
+
f"Exception: {test_exception.__name__}\n"
|
|
76
|
+
),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
self.assertRaises(
|
|
81
|
+
test_exception,
|
|
82
|
+
test_func,
|
|
83
|
+
*args,
|
|
84
|
+
**kwargs,
|
|
85
|
+
)
|
|
86
|
+
except Exception as exception:
|
|
87
|
+
self._logger.log_error(
|
|
88
|
+
exception=exception,
|
|
89
|
+
raise_again=True,
|
|
90
|
+
)
|
|
91
|
+
|
|
63
92
|
def assert_type(
|
|
64
93
|
self,
|
|
65
94
|
func_name: str,
|
|
@@ -39,12 +39,13 @@ def get_path(relative_path: str, use_meipass: bool = False) -> str:
|
|
|
39
39
|
return os.path.join(base_path, relative_path)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def
|
|
42
|
+
def get_process_created_datetime(pid: int = os.getpid()) -> datetime.datetime:
|
|
43
43
|
"""
|
|
44
|
-
:
|
|
44
|
+
:param pid: ID of the process
|
|
45
|
+
:return: Datetime when the process was created
|
|
45
46
|
"""
|
|
46
47
|
|
|
47
|
-
process = psutil.Process(
|
|
48
|
+
process = psutil.Process(pid)
|
|
48
49
|
|
|
49
50
|
return datetime.datetime.fromtimestamp(
|
|
50
51
|
timestamp=process.create_time(),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|