pyquoks 2.0.1__py3-none-any.whl → 2.0.3__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.
pyquoks/data.py CHANGED
@@ -213,7 +213,8 @@ class StringsProvider(pyquoks.utils._HasRequiredAttributes):
213
213
  """
214
214
 
215
215
  # noinspection PyUnusedLocal
216
- def __init__(self, parent: StringsProvider) -> None: ... # TODO
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(
pyquoks/test.py CHANGED
@@ -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,
pyquoks/utils.py CHANGED
@@ -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 get_started_datetime() -> datetime.datetime:
42
+ def get_process_created_datetime(pid: int = os.getpid()) -> datetime.datetime:
43
43
  """
44
- :return: Datetime when the current process was started
44
+ :param pid: ID of the process
45
+ :return: Datetime when the process was created
45
46
  """
46
47
 
47
- process = psutil.Process(os.getpid())
48
+ process = psutil.Process(pid)
48
49
 
49
50
  return datetime.datetime.fromtimestamp(
50
51
  timestamp=process.create_time(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyquoks
3
- Version: 2.0.1
3
+ Version: 2.0.3
4
4
  Summary: Пакет PyPI для часто используемых модулей в проектах diquoks
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -0,0 +1,10 @@
1
+ pyquoks/__init__.py,sha256=r70_95sq0zntKp4Jjkk_0hgDMBzUGtCK8EGkkCA6k1c,143
2
+ pyquoks/data.py,sha256=UIGz2SexV1-2mTZikJWyOiOXo7aigF3A_vIkYnH2UZ8,16260
3
+ pyquoks/localhost.py,sha256=-SG-VFoQ7gLksydlDFL3jrHwjNDurHkbXWB1rRxuFaA,1087
4
+ pyquoks/models.py,sha256=pJ165gZnc9eeQnLJhJ3om6nhL3c2UZ9THDu060N3V1w,4154
5
+ pyquoks/test.py,sha256=dkVEpNz2WczGbQThOsQU8A4_IcoMlakvZJ1hwObhjIQ,3035
6
+ pyquoks/utils.py,sha256=DY7qPgl84-Ff2dQQYdLf7w4la6FmQ2pWDw-zHWdj1JE,1499
7
+ pyquoks-2.0.3.dist-info/licenses/LICENSE,sha256=eEd8UIYxvKUY7vqrV1XTFo70_FQdiW6o1fznseCXRJs,1095
8
+ pyquoks-2.0.3.dist-info/METADATA,sha256=0wXiKEuPxQRRF-6WYF-ypwHAPXippSwLY3oYCmARL6Q,1714
9
+ pyquoks-2.0.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
10
+ pyquoks-2.0.3.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- pyquoks/__init__.py,sha256=r70_95sq0zntKp4Jjkk_0hgDMBzUGtCK8EGkkCA6k1c,143
2
- pyquoks/data.py,sha256=cbiMsUf6lXkc3fWxya906HgCjdVNa-NKkgx_TJG0EiU,16239
3
- pyquoks/localhost.py,sha256=-SG-VFoQ7gLksydlDFL3jrHwjNDurHkbXWB1rRxuFaA,1087
4
- pyquoks/models.py,sha256=pJ165gZnc9eeQnLJhJ3om6nhL3c2UZ9THDu060N3V1w,4154
5
- pyquoks/test.py,sha256=Dw4nVResnFatBQtFZnl1OKdIkVbmmeATEBRLOhfPcac,2219
6
- pyquoks/utils.py,sha256=jJCJlijHNCUKziXYmgBlbrEjXSHEHvlY9QDpISvU0Q0,1450
7
- pyquoks-2.0.1.dist-info/licenses/LICENSE,sha256=eEd8UIYxvKUY7vqrV1XTFo70_FQdiW6o1fznseCXRJs,1095
8
- pyquoks-2.0.1.dist-info/METADATA,sha256=i7Wnxxk5rbhk9prWv_X_U60gXm9iOA2Nh5IG6EL_yEw,1714
9
- pyquoks-2.0.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
10
- pyquoks-2.0.1.dist-info/RECORD,,