-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed to allow json_encoder_cls and json_decoder_cls to be passed a…
…s application constructor parameters, to support injection of custom JSON encoder and decoder (used to serialize and deserialize stored domain events).
- Loading branch information
1 parent
1326083
commit 7f9dd66
Showing
12 changed files
with
45 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
eventsourcing/infrastructure/stored_events/shared_memory_stored_events.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
import unittest | ||
|
||
from sqlalchemy.orm.scoping import ScopedSession | ||
|
||
from eventsourcing.application.example.with_sqlalchemy import ExampleApplicationWithSQLAlchemy | ||
from eventsourcing.domain.model.example import Example | ||
from eventsourcing.infrastructure.event_sourced_repos.example_repo import ExampleRepository | ||
from eventsourcing.infrastructure.event_store import EventStore | ||
from eventsourcing.infrastructure.persistence_subscriber import PersistenceSubscriber | ||
from eventsourcing.infrastructure.stored_events.base import StoredEventRepository | ||
from eventsourcing.infrastructure.stored_events.transcoders import ObjectJSONEncoder, ObjectJSONDecoder | ||
from eventsourcingtests.example_application_testcase import ExampleApplicationTestCase | ||
|
||
|
||
class TestApplicationWithSQLAlchemy(ExampleApplicationTestCase): | ||
|
||
def test_application_with_sqlalchemy(self): | ||
# Setup the example application, use it as a context manager. | ||
with ExampleApplicationWithSQLAlchemy(db_uri='sqlite:///:memory:') as app: | ||
with ExampleApplicationWithSQLAlchemy(db_uri='sqlite:///:memory:', json_encoder_cls=ObjectJSONEncoder, json_decoder_cls=ObjectJSONDecoder) as app: | ||
self.assert_is_example_application(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters