eventsourcing 9.3.0__py3-none-any.whl → 9.3.0b1__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.
Potentially problematic release.
This version of eventsourcing might be problematic. Click here for more details.
- eventsourcing/application.py +0 -10
- eventsourcing/examples/aggregate4/domainmodel.py +28 -14
- eventsourcing/examples/contentmanagementsystem/test_system.py +113 -119
- eventsourcing/examples/searchablecontent/test_application.py +5 -4
- eventsourcing/examples/searchablecontent/test_recorder.py +5 -4
- eventsourcing/examples/searchabletimestamps/test_searchabletimestamps.py +5 -8
- eventsourcing/postgres.py +22 -28
- eventsourcing/system.py +0 -10
- eventsourcing/tests/docs_tests/test_docs.py +10 -10
- eventsourcing/tests/domain_tests/test_aggregate.py +0 -7
- eventsourcing/tests/persistence.py +0 -3
- eventsourcing/tests/persistence_tests/test_postgres.py +106 -104
- eventsourcing/tests/system_tests/test_runner.py +17 -17
- eventsourcing/tests/system_tests/test_system.py +4 -1
- {eventsourcing-9.3.0.dist-info → eventsourcing-9.3.0b1.dist-info}/METADATA +4 -6
- {eventsourcing-9.3.0.dist-info → eventsourcing-9.3.0b1.dist-info}/RECORD +18 -19
- {eventsourcing-9.3.0.dist-info → eventsourcing-9.3.0b1.dist-info}/WHEEL +1 -1
- eventsourcing-9.3.0.dist-info/AUTHORS +0 -10
- {eventsourcing-9.3.0.dist-info → eventsourcing-9.3.0b1.dist-info}/LICENSE +0 -0
|
@@ -20,32 +20,32 @@ class TestDocs(TestCase):
|
|
|
20
20
|
super().setUp()
|
|
21
21
|
self.uris = tmpfile_uris()
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
db = PostgresDatastore(
|
|
24
24
|
"eventsourcing",
|
|
25
25
|
"127.0.0.1",
|
|
26
26
|
"5432",
|
|
27
27
|
"eventsourcing",
|
|
28
28
|
"eventsourcing",
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
)
|
|
30
|
+
drop_postgres_table(db, "dogschool_events")
|
|
31
|
+
drop_postgres_table(db, "counters_events")
|
|
32
|
+
drop_postgres_table(db, "counters_tracking")
|
|
33
33
|
|
|
34
34
|
def tearDown(self) -> None:
|
|
35
35
|
self.clean_env()
|
|
36
36
|
|
|
37
37
|
def clean_env(self):
|
|
38
38
|
clear_topic_cache()
|
|
39
|
-
|
|
39
|
+
db = PostgresDatastore(
|
|
40
40
|
"eventsourcing",
|
|
41
41
|
"127.0.0.1",
|
|
42
42
|
"5432",
|
|
43
43
|
"eventsourcing",
|
|
44
44
|
"eventsourcing",
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
)
|
|
46
|
+
drop_postgres_table(db, "dogschool_events")
|
|
47
|
+
drop_postgres_table(db, "counters_events")
|
|
48
|
+
drop_postgres_table(db, "counters_tracking")
|
|
49
49
|
|
|
50
50
|
keys = [
|
|
51
51
|
"PERSISTENCE_MODULE",
|
|
@@ -5,7 +5,6 @@ from decimal import Decimal
|
|
|
5
5
|
from unittest.case import TestCase
|
|
6
6
|
from uuid import NAMESPACE_URL, UUID, uuid4, uuid5
|
|
7
7
|
|
|
8
|
-
from eventsourcing.application import AggregateNotFound, AggregateNotFoundError
|
|
9
8
|
from eventsourcing.domain import (
|
|
10
9
|
Aggregate,
|
|
11
10
|
AggregateCreated,
|
|
@@ -1172,9 +1171,3 @@ class TestBankAccount(TestCase):
|
|
|
1172
1171
|
# Collect pending events.
|
|
1173
1172
|
pending = account.collect_events()
|
|
1174
1173
|
self.assertEqual(len(pending), 7)
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
class TestAggregateNotFound(TestCase):
|
|
1178
|
-
def test(self):
|
|
1179
|
-
e = AggregateNotFound()
|
|
1180
|
-
self.assertIsInstance(e, AggregateNotFoundError)
|
|
@@ -839,9 +839,6 @@ class InfrastructureFactoryTestCase(ABC, TestCase):
|
|
|
839
839
|
self.transcoder.register(DecimalAsStr())
|
|
840
840
|
self.transcoder.register(DatetimeAsISO())
|
|
841
841
|
|
|
842
|
-
def tearDown(self):
|
|
843
|
-
self.factory.close()
|
|
844
|
-
|
|
845
842
|
def test_createmapper(self):
|
|
846
843
|
# Want to construct:
|
|
847
844
|
# - application recorder
|
|
@@ -53,26 +53,26 @@ class TestPostgresDatastore(TestCase):
|
|
|
53
53
|
self.assertTrue(psycopg.Pipeline.is_supported())
|
|
54
54
|
|
|
55
55
|
def test_has_connection_pool(self):
|
|
56
|
-
|
|
56
|
+
datastore = PostgresDatastore(
|
|
57
57
|
dbname="eventsourcing",
|
|
58
58
|
host="127.0.0.1",
|
|
59
59
|
port="5432",
|
|
60
60
|
user="eventsourcing",
|
|
61
61
|
password="eventsourcing", # noqa: S106
|
|
62
|
-
)
|
|
63
|
-
|
|
62
|
+
)
|
|
63
|
+
self.assertIsInstance(datastore.pool, ConnectionPool)
|
|
64
64
|
|
|
65
65
|
def test_get_connection(self):
|
|
66
|
-
|
|
66
|
+
datastore = PostgresDatastore(
|
|
67
67
|
dbname="eventsourcing",
|
|
68
68
|
host="127.0.0.1",
|
|
69
69
|
port="5432",
|
|
70
70
|
user="eventsourcing",
|
|
71
71
|
password="eventsourcing", # noqa: S106
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
)
|
|
73
|
+
conn: Connection
|
|
74
|
+
with datastore.get_connection() as conn:
|
|
75
|
+
self.assertIsInstance(conn, Connection)
|
|
76
76
|
|
|
77
77
|
def test_context_manager_converts_exceptions_and_conditionally_calls_close(self):
|
|
78
78
|
cases = [
|
|
@@ -88,30 +88,31 @@ class TestPostgresDatastore(TestCase):
|
|
|
88
88
|
(TypeError, TypeError(), True),
|
|
89
89
|
(TypeError, TypeError, True),
|
|
90
90
|
]
|
|
91
|
-
|
|
91
|
+
datastore = PostgresDatastore(
|
|
92
92
|
dbname="eventsourcing",
|
|
93
93
|
host="127.0.0.1",
|
|
94
94
|
port="5432",
|
|
95
95
|
user="eventsourcing",
|
|
96
96
|
password="eventsourcing", # noqa: S106
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
)
|
|
98
|
+
for expected_exc_type, raised_exc, expect_conn_closed in cases:
|
|
99
|
+
with self.assertRaises(expected_exc_type):
|
|
100
|
+
conn: Connection
|
|
101
|
+
with datastore.get_connection() as conn:
|
|
102
|
+
self.assertFalse(conn.closed)
|
|
103
|
+
raise raised_exc
|
|
104
|
+
self.assertTrue(conn.closed is expect_conn_closed, raised_exc)
|
|
105
105
|
|
|
106
106
|
def test_transaction_from_datastore(self):
|
|
107
|
-
|
|
107
|
+
datastore = PostgresDatastore(
|
|
108
108
|
dbname="eventsourcing",
|
|
109
109
|
host="127.0.0.1",
|
|
110
110
|
port="5432",
|
|
111
111
|
user="eventsourcing",
|
|
112
112
|
password="eventsourcing", # noqa: S106
|
|
113
|
-
)
|
|
114
|
-
|
|
113
|
+
)
|
|
114
|
+
# As a convenience, we can use the transaction() method.
|
|
115
|
+
with datastore.transaction(commit=False) as curs:
|
|
115
116
|
curs.execute("SELECT 1")
|
|
116
117
|
self.assertEqual(curs.fetchall(), [{"?column?": 1}])
|
|
117
118
|
|
|
@@ -127,14 +128,15 @@ class TestPostgresDatastore(TestCase):
|
|
|
127
128
|
with self.assertRaises(OperationalError), datastore.get_connection():
|
|
128
129
|
pass
|
|
129
130
|
|
|
130
|
-
|
|
131
|
+
datastore = PostgresDatastore(
|
|
131
132
|
dbname="eventsourcing",
|
|
132
133
|
host="127.0.0.1",
|
|
133
134
|
port="987654321", # bad value
|
|
134
135
|
user="eventsourcing",
|
|
135
136
|
password="eventsourcing", # noqa: S106
|
|
136
137
|
pool_open_timeout=2,
|
|
137
|
-
)
|
|
138
|
+
)
|
|
139
|
+
with self.assertRaises(OperationalError), datastore.get_connection():
|
|
138
140
|
pass
|
|
139
141
|
|
|
140
142
|
@skipIf(
|
|
@@ -144,7 +146,7 @@ class TestPostgresDatastore(TestCase):
|
|
|
144
146
|
def test_pre_ping(self):
|
|
145
147
|
# Define method to open and close a connection, and then execute a statement.
|
|
146
148
|
def open_close_execute(*, pre_ping: bool):
|
|
147
|
-
|
|
149
|
+
datastore = PostgresDatastore(
|
|
148
150
|
dbname="eventsourcing",
|
|
149
151
|
host="127.0.0.1",
|
|
150
152
|
port="5432",
|
|
@@ -152,28 +154,28 @@ class TestPostgresDatastore(TestCase):
|
|
|
152
154
|
password="eventsourcing", # noqa: S106
|
|
153
155
|
pool_size=1,
|
|
154
156
|
pre_ping=pre_ping,
|
|
155
|
-
)
|
|
157
|
+
)
|
|
156
158
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
# Create a connection.
|
|
160
|
+
conn: Connection
|
|
161
|
+
with datastore.get_connection() as conn, conn.cursor() as curs:
|
|
162
|
+
curs.execute("SELECT 1")
|
|
163
|
+
self.assertEqual(curs.fetchall(), [{"?column?": 1}])
|
|
162
164
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
# Close all connections via separate connection.
|
|
166
|
+
pg_close_all_connections()
|
|
165
167
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
# Check the connection doesn't think it's closed.
|
|
169
|
+
self.assertTrue(datastore.pool._pool)
|
|
170
|
+
self.assertFalse(datastore.pool._pool[0].closed)
|
|
169
171
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
# Get a closed connection.
|
|
173
|
+
conn: Connection
|
|
174
|
+
with datastore.get_connection() as conn:
|
|
175
|
+
self.assertFalse(conn.closed)
|
|
174
176
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
+
with conn.cursor() as curs:
|
|
178
|
+
curs.execute("SELECT 1")
|
|
177
179
|
|
|
178
180
|
# Check using the closed connection gives an error.
|
|
179
181
|
with self.assertRaises(OperationalError):
|
|
@@ -183,62 +185,60 @@ class TestPostgresDatastore(TestCase):
|
|
|
183
185
|
open_close_execute(pre_ping=True)
|
|
184
186
|
|
|
185
187
|
def test_idle_in_transaction_session_timeout(self):
|
|
186
|
-
|
|
188
|
+
datastore = PostgresDatastore(
|
|
187
189
|
dbname="eventsourcing",
|
|
188
190
|
host="127.0.0.1",
|
|
189
191
|
port="5432",
|
|
190
192
|
user="eventsourcing",
|
|
191
193
|
password="eventsourcing", # noqa: S106
|
|
192
194
|
idle_in_transaction_session_timeout=1,
|
|
193
|
-
)
|
|
195
|
+
)
|
|
194
196
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
self.assertFalse(curs.closed)
|
|
211
|
-
sleep(2)
|
|
197
|
+
# Error on commit is raised.
|
|
198
|
+
with self.assertRaises(OperationalError), datastore.get_connection() as curs:
|
|
199
|
+
curs.execute("BEGIN")
|
|
200
|
+
curs.execute("SELECT 1")
|
|
201
|
+
self.assertFalse(curs.closed)
|
|
202
|
+
sleep(2)
|
|
203
|
+
|
|
204
|
+
# Error on commit is raised.
|
|
205
|
+
with self.assertRaises(OperationalError), datastore.transaction(
|
|
206
|
+
commit=True
|
|
207
|
+
) as curs:
|
|
208
|
+
# curs.execute("BEGIN")
|
|
209
|
+
curs.execute("SELECT 1")
|
|
210
|
+
self.assertFalse(curs.closed)
|
|
211
|
+
sleep(2)
|
|
212
212
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
# Force rollback. Error is ignored.
|
|
214
|
+
with datastore.transaction(commit=False) as curs:
|
|
215
|
+
# curs.execute("BEGIN")
|
|
216
|
+
curs.execute("SELECT 1")
|
|
217
|
+
self.assertFalse(curs.closed)
|
|
218
|
+
sleep(2)
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
220
|
+
# Autocommit mode - transaction is commited in time.
|
|
221
|
+
with datastore.get_connection() as curs:
|
|
222
|
+
curs.execute("SELECT 1")
|
|
223
|
+
self.assertFalse(curs.closed)
|
|
224
|
+
sleep(2)
|
|
225
225
|
|
|
226
226
|
def test_get_password_func(self):
|
|
227
227
|
# Check correct password is required, wrong password causes operational error.
|
|
228
|
-
|
|
228
|
+
datastore = PostgresDatastore(
|
|
229
229
|
dbname="eventsourcing",
|
|
230
230
|
host="127.0.0.1",
|
|
231
231
|
port="5432",
|
|
232
232
|
user="eventsourcing",
|
|
233
233
|
password="wrong", # noqa: S106
|
|
234
234
|
pool_size=1,
|
|
235
|
-
)
|
|
235
|
+
)
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
conn: Connection
|
|
238
|
+
with self.assertRaises(
|
|
239
|
+
OperationalError
|
|
240
|
+
), datastore.get_connection() as conn, conn.cursor() as curs:
|
|
241
|
+
curs.execute("SELECT 1")
|
|
242
242
|
|
|
243
243
|
# Define a "get password" function, with a generator that returns
|
|
244
244
|
# wrong password a few times first.
|
|
@@ -253,7 +253,7 @@ class TestPostgresDatastore(TestCase):
|
|
|
253
253
|
return next(password_generator)
|
|
254
254
|
|
|
255
255
|
# Construct datastore with "get password" function.
|
|
256
|
-
|
|
256
|
+
datastore = PostgresDatastore(
|
|
257
257
|
dbname="eventsourcing",
|
|
258
258
|
host="127.0.0.1",
|
|
259
259
|
port="5432",
|
|
@@ -262,9 +262,11 @@ class TestPostgresDatastore(TestCase):
|
|
|
262
262
|
pool_size=1,
|
|
263
263
|
get_password_func=get_password_func,
|
|
264
264
|
connect_timeout=10,
|
|
265
|
-
)
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
# Create a connection, and check it works (this test depends on psycopg
|
|
268
|
+
# retrying attempt to connect, should call "get password" twice).
|
|
269
|
+
with datastore.get_connection() as conn, conn.cursor() as curs:
|
|
268
270
|
curs.execute("SELECT 1")
|
|
269
271
|
self.assertEqual(curs.fetchall(), [{"?column?": 1}])
|
|
270
272
|
|
|
@@ -779,15 +781,15 @@ class TestPostgresInfrastructureFactory(InfrastructureFactoryTestCase):
|
|
|
779
781
|
super().tearDown()
|
|
780
782
|
|
|
781
783
|
def drop_tables(self):
|
|
782
|
-
|
|
784
|
+
datastore = PostgresDatastore(
|
|
783
785
|
"eventsourcing",
|
|
784
786
|
"127.0.0.1",
|
|
785
787
|
"5432",
|
|
786
788
|
"eventsourcing",
|
|
787
789
|
"eventsourcing",
|
|
788
|
-
)
|
|
789
|
-
|
|
790
|
-
|
|
790
|
+
)
|
|
791
|
+
drop_postgres_table(datastore, "testcase_events")
|
|
792
|
+
drop_postgres_table(datastore, "testcase_tracking")
|
|
791
793
|
|
|
792
794
|
def test_close(self):
|
|
793
795
|
factory = Factory(self.env)
|
|
@@ -818,16 +820,16 @@ class TestPostgresInfrastructureFactory(InfrastructureFactoryTestCase):
|
|
|
818
820
|
self.assertEqual(self.factory.datastore.pool.min_size, 5)
|
|
819
821
|
|
|
820
822
|
def test_max_overflow_is_ten_by_default(self):
|
|
821
|
-
self.assertTrue(Factory.
|
|
823
|
+
self.assertTrue(Factory.POSTGRES_POOL_MAX_OVERFLOW not in self.env)
|
|
822
824
|
self.factory = Factory(self.env)
|
|
823
825
|
self.assertEqual(self.factory.datastore.pool.max_size, 15)
|
|
824
826
|
|
|
825
|
-
self.env[Factory.
|
|
827
|
+
self.env[Factory.POSTGRES_POOL_MAX_OVERFLOW] = ""
|
|
826
828
|
self.factory = Factory(self.env)
|
|
827
829
|
self.assertEqual(self.factory.datastore.pool.max_size, 15)
|
|
828
830
|
|
|
829
831
|
def test_max_overflow_is_set(self):
|
|
830
|
-
self.env[Factory.
|
|
832
|
+
self.env[Factory.POSTGRES_POOL_MAX_OVERFLOW] = "7"
|
|
831
833
|
self.factory = Factory(self.env)
|
|
832
834
|
self.assertEqual(self.factory.datastore.pool.max_size, 12)
|
|
833
835
|
|
|
@@ -836,31 +838,31 @@ class TestPostgresInfrastructureFactory(InfrastructureFactoryTestCase):
|
|
|
836
838
|
self.factory = Factory(self.env)
|
|
837
839
|
self.assertEqual(self.factory.datastore.pool.min_size, 6)
|
|
838
840
|
|
|
839
|
-
def
|
|
841
|
+
def test_connect_timeout_is_five_by_default(self):
|
|
840
842
|
self.assertTrue(Factory.POSTGRES_CONNECT_TIMEOUT not in self.env)
|
|
841
843
|
self.factory = Factory(self.env)
|
|
842
|
-
self.assertEqual(self.factory.datastore.pool.timeout,
|
|
844
|
+
self.assertEqual(self.factory.datastore.pool.timeout, 5)
|
|
843
845
|
|
|
844
846
|
self.env[Factory.POSTGRES_CONNECT_TIMEOUT] = ""
|
|
845
847
|
self.factory = Factory(self.env)
|
|
846
|
-
self.assertEqual(self.factory.datastore.pool.timeout,
|
|
848
|
+
self.assertEqual(self.factory.datastore.pool.timeout, 5)
|
|
847
849
|
|
|
848
850
|
def test_connect_timeout_is_set(self):
|
|
849
851
|
self.env[Factory.POSTGRES_CONNECT_TIMEOUT] = "8"
|
|
850
852
|
self.factory = Factory(self.env)
|
|
851
853
|
self.assertEqual(self.factory.datastore.pool.timeout, 8)
|
|
852
854
|
|
|
853
|
-
def
|
|
854
|
-
self.assertTrue(Factory.
|
|
855
|
+
def test_pool_timeout_is_30_by_default(self):
|
|
856
|
+
self.assertTrue(Factory.POSTGRES_POOL_TIMEOUT not in self.env)
|
|
855
857
|
self.factory = Factory(self.env)
|
|
856
|
-
self.assertEqual(self.factory.datastore.pool.max_waiting,
|
|
858
|
+
self.assertEqual(self.factory.datastore.pool.max_waiting, 30)
|
|
857
859
|
|
|
858
|
-
self.env[Factory.
|
|
860
|
+
self.env[Factory.POSTGRES_POOL_TIMEOUT] = ""
|
|
859
861
|
self.factory = Factory(self.env)
|
|
860
|
-
self.assertEqual(self.factory.datastore.pool.max_waiting,
|
|
862
|
+
self.assertEqual(self.factory.datastore.pool.max_waiting, 30)
|
|
861
863
|
|
|
862
|
-
def
|
|
863
|
-
self.env[Factory.
|
|
864
|
+
def test_pool_timeout_is_set(self):
|
|
865
|
+
self.env[Factory.POSTGRES_POOL_TIMEOUT] = "8"
|
|
864
866
|
self.factory = Factory(self.env)
|
|
865
867
|
self.assertEqual(self.factory.datastore.pool.max_waiting, 8)
|
|
866
868
|
|
|
@@ -943,14 +945,14 @@ class TestPostgresInfrastructureFactory(InfrastructureFactoryTestCase):
|
|
|
943
945
|
"is invalid. If set, an integer or empty string is expected: 'abc'",
|
|
944
946
|
)
|
|
945
947
|
|
|
946
|
-
def
|
|
947
|
-
self.env[Factory.
|
|
948
|
+
def test_environment_error_raised_when_pool_timeout_not_an_integer(self):
|
|
949
|
+
self.env[Factory.POSTGRES_POOL_TIMEOUT] = "abc"
|
|
948
950
|
with self.assertRaises(EnvironmentError) as cm:
|
|
949
951
|
Factory(self.env)
|
|
950
952
|
self.assertEqual(
|
|
951
953
|
cm.exception.args[0],
|
|
952
|
-
"Postgres environment value for key '
|
|
953
|
-
"is invalid. If set,
|
|
954
|
+
"Postgres environment value for key 'POSTGRES_POOL_TIMEOUT' "
|
|
955
|
+
"is invalid. If set, a float or empty string is expected: 'abc'",
|
|
954
956
|
)
|
|
955
957
|
|
|
956
958
|
def test_environment_error_raised_when_lock_timeout_not_an_integer(self):
|
|
@@ -974,12 +976,12 @@ class TestPostgresInfrastructureFactory(InfrastructureFactoryTestCase):
|
|
|
974
976
|
)
|
|
975
977
|
|
|
976
978
|
def test_environment_error_raised_when_max_conn_not_an_integer(self):
|
|
977
|
-
self.env[Factory.
|
|
979
|
+
self.env[Factory.POSTGRES_POOL_MAX_OVERFLOW] = "abc"
|
|
978
980
|
with self.assertRaises(EnvironmentError) as cm:
|
|
979
981
|
Factory(self.env)
|
|
980
982
|
self.assertEqual(
|
|
981
983
|
cm.exception.args[0],
|
|
982
|
-
"Postgres environment value for key '
|
|
984
|
+
"Postgres environment value for key 'POSTGRES_POOL_MAX_OVERFLOW' "
|
|
983
985
|
"is invalid. If set, an integer or empty string is expected: 'abc'",
|
|
984
986
|
)
|
|
985
987
|
|
|
@@ -738,28 +738,28 @@ class TestMultiThreadedRunnerWithPostgres(TestMultiThreadedRunner):
|
|
|
738
738
|
os.environ["POSTGRES_USER"] = "eventsourcing"
|
|
739
739
|
os.environ["POSTGRES_PASSWORD"] = "eventsourcing" # noqa: S105
|
|
740
740
|
|
|
741
|
-
|
|
741
|
+
db = PostgresDatastore(
|
|
742
742
|
os.getenv("POSTGRES_DBNAME"),
|
|
743
743
|
os.getenv("POSTGRES_HOST"),
|
|
744
744
|
os.getenv("POSTGRES_PORT"),
|
|
745
745
|
os.getenv("POSTGRES_USER"),
|
|
746
746
|
os.getenv("POSTGRES_PASSWORD"),
|
|
747
|
-
)
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
747
|
+
)
|
|
748
|
+
drop_postgres_table(db, f"{BankAccounts.name.lower()}_events")
|
|
749
|
+
drop_postgres_table(db, f"{EmailProcess.name.lower()}_events")
|
|
750
|
+
drop_postgres_table(db, f"{EmailProcess.name.lower()}_tracking")
|
|
751
|
+
drop_postgres_table(db, f"{EmailProcess.name.lower()}2_events")
|
|
752
|
+
drop_postgres_table(db, f"{EmailProcess.name.lower()}2_tracking")
|
|
753
|
+
drop_postgres_table(db, "brokenprocessing_events")
|
|
754
|
+
drop_postgres_table(db, "brokenprocessing_tracking")
|
|
755
|
+
drop_postgres_table(db, "brokenconverting_events")
|
|
756
|
+
drop_postgres_table(db, "brokenconverting_tracking")
|
|
757
|
+
drop_postgres_table(db, "brokenpulling_events")
|
|
758
|
+
drop_postgres_table(db, "brokenpulling_tracking")
|
|
759
|
+
drop_postgres_table(db, "commands_events")
|
|
760
|
+
drop_postgres_table(db, "commands_tracking")
|
|
761
|
+
drop_postgres_table(db, "results_events")
|
|
762
|
+
drop_postgres_table(db, "results_tracking")
|
|
763
763
|
|
|
764
764
|
os.environ["PERSISTENCE_MODULE"] = "eventsourcing.postgres"
|
|
765
765
|
|
|
@@ -155,7 +155,10 @@ class TestSystem(TestCase):
|
|
|
155
155
|
|
|
156
156
|
def test_system_has_topic_if_defined_as_module_attribute(self):
|
|
157
157
|
system_topic = system_defined_as_global.topic
|
|
158
|
-
self.
|
|
158
|
+
self.assertEqual(
|
|
159
|
+
system_topic,
|
|
160
|
+
"eventsourcing.tests.system_tests.test_system:system_defined_as_global",
|
|
161
|
+
)
|
|
159
162
|
self.assertEqual(resolve_topic(system_topic), system_defined_as_global)
|
|
160
163
|
|
|
161
164
|
def test_system_topic_is_none_if_defined_in_function_body(self):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: eventsourcing
|
|
3
|
-
Version: 9.3.
|
|
3
|
+
Version: 9.3.0b1
|
|
4
4
|
Summary: Event sourcing in Python
|
|
5
5
|
Home-page: https://github.com/pyeventsourcing/eventsourcing
|
|
6
6
|
License: BSD 3-Clause
|
|
@@ -8,7 +8,7 @@ Keywords: event sourcing,event store,domain driven design,domain-driven design,d
|
|
|
8
8
|
Author: John Bywater
|
|
9
9
|
Author-email: john.bywater@appropriatesoftware.net
|
|
10
10
|
Requires-Python: >=3.8,<4.0
|
|
11
|
-
Classifier: Development Status ::
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Intended Audience :: Education
|
|
14
14
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -29,13 +29,11 @@ Provides-Extra: postgres
|
|
|
29
29
|
Requires-Dist: Sphinx ; extra == "docs"
|
|
30
30
|
Requires-Dist: backports.zoneinfo ; python_version < "3.9"
|
|
31
31
|
Requires-Dist: orjson ; extra == "docs"
|
|
32
|
-
Requires-Dist: psycopg (<=3.
|
|
33
|
-
Requires-Dist: psycopg-c (<=3.2.1) ; (python_full_version <= "3.12.999999") and (extra == "postgres")
|
|
34
|
-
Requires-Dist: psycopg-pool (<=3.2.2) ; (python_full_version <= "3.12.999999") and (extra == "postgres")
|
|
32
|
+
Requires-Dist: psycopg[c,pool] (<=3.9.99999) ; extra == "postgres"
|
|
35
33
|
Requires-Dist: pycryptodome (<=3.20.99999) ; extra == "crypto"
|
|
36
34
|
Requires-Dist: pydantic ; extra == "docs"
|
|
37
35
|
Requires-Dist: sphinx_rtd_theme ; extra == "docs"
|
|
38
|
-
Requires-Dist: typing_extensions
|
|
36
|
+
Requires-Dist: typing_extensions ; python_version < "3.8"
|
|
39
37
|
Project-URL: Repository, https://github.com/pyeventsourcing/eventsourcing
|
|
40
38
|
Description-Content-Type: text/markdown
|
|
41
39
|
|