def t_sqlite_prepare_engine(self, db, tmp_path): result = Distro.get("sqlite") if db == "sqlite.db": db = tmp_path / "sqlite.db" url, _ = result.create_spec(server="srvr", database=db, engine_kwargs={}) assert str(db or ":memory:") in url
def t_prepare_for_other_engines(self, test_distro): if test_distro == "sqlite": pytest.skip("sqlite handled elsewhere") try: result = Distro.get(test_distro) except ModuleNotFoundError: pytest.skip(f"Missing {test_distro} module.") url, _ = result.create_spec(server="srvr", database="db", engine_kwargs=KeyReturner) assert test_distro in url
def t_get_exactly_one_distro_canonically(self, test_distro): try: result = Distro.get(test_distro) assert test_distro.lower() == result.name.lower() except ModuleNotFoundError: pytest.skip(f"Missing {test_distro} module.")
def t_fail_vague_distros(self, vaguename): with pytest.raises(SQLDistroNotFound): Distro.get(vaguename)
def t_fail_bad_distros(self, badname): with pytest.raises(SQLDistroNotFound): Distro.get(badname)
def t_get_exactly_one_distro_variants(self, canonical, incoming, test_distro): if canonical != test_distro: pytest.skip("") assert Distro.get(incoming).name == canonical assert Distro.get(incoming.upper()).name == canonical