| from __future__ import annotations | |
| import importlib.util | |
| from pathlib import Path | |
| def test_initial_migration_is_wired(): | |
| path = ( | |
| Path(__file__).resolve().parent.parent | |
| / "migrations" | |
| / "versions" | |
| / "0001_initial.py" | |
| ) | |
| spec = importlib.util.spec_from_file_location("mig_0001_initial", path) | |
| mod = importlib.util.module_from_spec(spec) | |
| spec.loader.exec_module(mod) | |
| assert mod.revision == "0001_initial" | |
| assert mod.down_revision is None | |
| assert callable(mod.upgrade) | |
| assert callable(mod.downgrade) | |