-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from Pogchamp-company/develop
Version 1.1.2
- Loading branch information
Showing
5 changed files
with
100 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import TYPE_CHECKING | ||
|
||
from tests.base.render_and_run import compare_and_run | ||
|
||
if TYPE_CHECKING: | ||
from sqlalchemy import Connection | ||
from sqlalchemy import MetaData | ||
|
||
|
||
class CompareAndRunTestCase(ABC): | ||
@abstractmethod | ||
def get_database_schema(self) -> MetaData: ... | ||
|
||
@abstractmethod | ||
def get_target_schema(self) -> MetaData: ... | ||
|
||
@abstractmethod | ||
def get_expected_upgrade(self) -> str: ... | ||
|
||
@abstractmethod | ||
def get_expected_downgrade(self) -> str: ... | ||
|
||
def test_run(self, connection: "Connection"): | ||
database_schema = self.get_database_schema() | ||
target_schema = self.get_target_schema() | ||
|
||
database_schema.create_all(connection) | ||
|
||
compare_and_run( | ||
connection, | ||
target_schema, | ||
expected_upgrade=self.get_expected_upgrade(), | ||
expected_downgrade=self.get_expected_downgrade(), | ||
) |
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