Newer
Older
TEST_DATA = Path(__file__).absolute().parent / "data"
@pytest.mark.parametrize(
"wrapper",
[{"templates": "database.db", "sources": "", "dbds": "", "headers": ""}],
indirect=True,
)
def test_patch(wrapper):
wrapper_dir = wrapper
rc, outs, _ = run_make(
wrapper_dir,
"init",
__DEBUG_VERSION="0.0.0",
assert "You are in the local source mode" in outs.decode("utf-8")
rc, _, _ = run_make(wrapper_dir, "patch")
assert rc == 0
with open(wrapper_dir / "build" / "database.db", "r") as f:
db_contents = f.read()
assert 'field(DESC, "OK")' in db_contents
assert not "Bad" in db_contents
run_make(wrapper_dir, "build")
assert any((wrapper_dir / "build").glob("O.*"))