testgres.common 0.0.4__tar.gz → 1.0.0__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.
- {testgres_common-0.0.4 → testgres_common-1.0.0}/PKG-INFO +3 -1
- {testgres_common-0.0.4 → testgres_common-1.0.0}/README.md +2 -0
- {testgres_common-0.0.4 → testgres_common-1.0.0}/pyproject.toml +1 -1
- testgres_common-1.0.0/src/exceptions.py +56 -0
- {testgres_common-0.0.4 → testgres_common-1.0.0}/testgres.common.egg-info/PKG-INFO +3 -1
- testgres_common-0.0.4/src/exceptions.py +0 -9
- {testgres_common-0.0.4 → testgres_common-1.0.0}/LICENSE +0 -0
- {testgres_common-0.0.4 → testgres_common-1.0.0}/setup.cfg +0 -0
- {testgres_common-0.0.4 → testgres_common-1.0.0}/testgres.common.egg-info/SOURCES.txt +0 -0
- {testgres_common-0.0.4 → testgres_common-1.0.0}/testgres.common.egg-info/dependency_links.txt +0 -0
- {testgres_common-0.0.4 → testgres_common-1.0.0}/testgres.common.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: testgres.common
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Testgres common code
|
|
5
5
|
Author-email: Postgres Professional <testgres@postgrespro.ru>
|
|
6
6
|
License: PostgreSQL
|
|
@@ -26,6 +26,8 @@ Dynamic: license-file
|
|
|
26
26
|
|
|
27
27
|
[](https://app.travis-ci.com/postgrespro/testgres.common)
|
|
28
28
|
[](https://badge.fury.io/py/testgres.common)
|
|
29
|
+
[](https://pypi.org/project/testgres.common)
|
|
30
|
+
[](https://pypi.org/project/testgres.common)
|
|
29
31
|
|
|
30
32
|
# testgres - common
|
|
31
33
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[](https://app.travis-ci.com/postgrespro/testgres.common)
|
|
2
2
|
[](https://badge.fury.io/py/testgres.common)
|
|
3
|
+
[](https://pypi.org/project/testgres.common)
|
|
4
|
+
[](https://pypi.org/project/testgres.common)
|
|
3
5
|
|
|
4
6
|
# testgres - common
|
|
5
7
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
import typing
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class TestgresException(Exception):
|
|
6
|
+
@property
|
|
7
|
+
def message(self) -> str:
|
|
8
|
+
assert isinstance(self, TestgresException)
|
|
9
|
+
r = super().__str__()
|
|
10
|
+
assert r is not None
|
|
11
|
+
assert type(r) == str # noqa: E721
|
|
12
|
+
return r
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def source(self) -> typing.Optional[str]:
|
|
16
|
+
assert isinstance(self, TestgresException)
|
|
17
|
+
return None
|
|
18
|
+
|
|
19
|
+
def __str__(self) -> str:
|
|
20
|
+
r = self.message
|
|
21
|
+
assert type(r) == str # noqa: E721
|
|
22
|
+
return r
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class InvalidOperationException(TestgresException):
|
|
26
|
+
_message: str
|
|
27
|
+
_source: typing.Optional[str]
|
|
28
|
+
|
|
29
|
+
def __init__(self, message: str, source: typing.Optional[str] = None):
|
|
30
|
+
assert type(message) == str # noqa: E721
|
|
31
|
+
assert source is None or type(source) == str # noqa: E721
|
|
32
|
+
super().__init__()
|
|
33
|
+
self._message = message
|
|
34
|
+
self._source = source
|
|
35
|
+
return
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def message(self) -> str:
|
|
39
|
+
assert type(self._message) == str # noqa: E721
|
|
40
|
+
return self._message
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def source(self) -> str:
|
|
44
|
+
assert self._source is None or type(self._source) == str # noqa: E721
|
|
45
|
+
return self._source
|
|
46
|
+
|
|
47
|
+
def __repr__(self) -> str:
|
|
48
|
+
# It must be overrided!
|
|
49
|
+
assert type(self) == InvalidOperationException # noqa: E721
|
|
50
|
+
r = "{}({}, {})".format(
|
|
51
|
+
__class__.__name__,
|
|
52
|
+
repr(self._message),
|
|
53
|
+
repr(self._source),
|
|
54
|
+
)
|
|
55
|
+
assert type(r) == str # noqa: E721
|
|
56
|
+
return r
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: testgres.common
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Testgres common code
|
|
5
5
|
Author-email: Postgres Professional <testgres@postgrespro.ru>
|
|
6
6
|
License: PostgreSQL
|
|
@@ -26,6 +26,8 @@ Dynamic: license-file
|
|
|
26
26
|
|
|
27
27
|
[](https://app.travis-ci.com/postgrespro/testgres.common)
|
|
28
28
|
[](https://badge.fury.io/py/testgres.common)
|
|
29
|
+
[](https://pypi.org/project/testgres.common)
|
|
30
|
+
[](https://pypi.org/project/testgres.common)
|
|
29
31
|
|
|
30
32
|
# testgres - common
|
|
31
33
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testgres_common-0.0.4 → testgres_common-1.0.0}/testgres.common.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|