-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test for host_organization migration
- Loading branch information
1 parent
2ea86e8
commit 2166520
Showing
2 changed files
with
25 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from hushline.db import db | ||
|
||
|
||
class UpgradeTester: | ||
def load_data(self) -> None: | ||
pass # migration loads data itself | ||
|
||
def check_upgrade(self) -> None: | ||
rows = list(db.session.execute(db.text("SELECT * FROM host_organization"))) | ||
assert len(rows) == 1 | ||
|
||
row = rows[0]._asdict() | ||
assert row["id"] == 1 | ||
|
||
|
||
class DowngradeTester: | ||
"""Nothing to do. It's just a table drop.""" | ||
|
||
def load_data(self) -> None: | ||
pass | ||
|
||
def check_downgrade(self) -> None: | ||
pass |